[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNGUIzh7aR3C/Hoz@kroah.com>
Date: Tue, 22 Jun 2021 09:41:23 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: minchan@...nel.org, jeyu@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, axboe@...nel.dk,
mbenes@...e.com, jpoimboe@...hat.com, tglx@...utronix.de,
keescook@...omium.org, jikos@...nel.org, rostedt@...dmis.org,
peterz@...radead.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] zram: fix deadlock with sysfs attribute usage and
driver removal
On Mon, Jun 21, 2021 at 04:36:34PM -0700, Luis Chamberlain wrote:
> + ssize_t __ret; \
> + if (!try_module_get(THIS_MODULE)) \
try_module_get(THIS_MODULE) is always racy and probably does not do what
you want it to do. You always want to get/put module references from
code that is NOT the code calling these functions.
> + return -ENODEV; \
> + __ret = _name ## _store(dev, attr, buf, len); \
> + module_put(THIS_MODULE); \
This too is going to be racy.
While fun to poke at, I still think this is pointless.
greg k-h
Powered by blists - more mailing lists