[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 21:32:24 +0000
From: "Verma, Vishal L" <vishal.l.verma@...el.com>
To: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC: "Williams, Dan J" <dan.j.williams@...el.com>, "Jiang, Dave"
<dave.jiang@...el.com>, "Schofield, Alison" <alison.schofield@...el.com>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>, "linux-mm@...ck.org"
<linux-mm@...ck.org>, "linux-cxl@...r.kernel.org"
<linux-cxl@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dax/bus.c: replace WARN_ON_ONCE() with lockdep asserts
On Thu, 2024-04-04 at 14:23 -0700, Andrew Morton wrote:
> On Tue, 02 Apr 2024 00:24:28 -0600 Vishal Verma <vishal.l.verma@...el.com> wrote:
>
> > In [1], Dan points out that all of the WARN_ON_ONCE() usage in the
> > referenced patch should be replaced with lockdep_assert_held(_write)().
> >
> > Replace those, and additionally, replace a couple of other
> > WARN_ON_ONCE() introduced in the same patch for actual failure
> > cases (i.e. when acquiring a semaphore fails in a remove / unregister
> > path) with dev_WARN_ONCE() as is the precedent here.
> >
> > Recall that previously, unregistration paths was implicitly protected by
> > overloading the device lock, which the patch in [1] sought to remove.
> > This meant adding a semaphore acquisition in these unregistration paths.
> > Since that can fail, and it doesn't make sense to return errors from
> > these paths, retain the two instances of (now) dev_WARN_ONCE().
> >
> > ...
> >
> > @@ -471,6 +471,7 @@ static void __unregister_dev_dax(void *dev)
> >
> > dev_dbg(dev, "%s\n", __func__);
> >
> > + lockdep_assert_held_write(&dax_region_rwsem);
> > kill_dev_dax(dev_dax);
> > device_del(dev);
> > free_dev_dax_ranges(dev_dax);
>
> This is new and unchangelogged?
>
> I'm taking Dan's reply to your patch as Not-A-Nack ;)
>
True, but with Dan's new feedback, that results in a bit more rework,
this will likely turn into 2-3 patches. Working on it now, will be out
shortly!
Powered by blists - more mailing lists