[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fm5et2vgfl5npfmivdpwj7lb5ztrgmvst4kbvxccisdnudyhhx@5szzuwprhmgw>
Date: Wed, 6 Aug 2025 11:58:49 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Jens Axboe <axboe@...nel.dk>, Minchan Kim <minchan@...nel.org>, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org, Seyediman Seyedarab <imandevel@...il.com>
Subject: Re: [PATCH] zram: protect recomp_algorithm_show() with ->init_lock
On (25/08/05 15:03), Andrew Morton wrote:
> On Tue, 5 Aug 2025 19:19:29 +0900 Sergey Senozhatsky <senozhatsky@...omium.org> wrote:
>
> > sysfs handlers should be called under ->init_lock and are not
> > supposed to unlock it until return, otherwise e.g. a concurrent
> > reset() can occur. There is one handler that breaks that rule:
> > recomp_algorithm_show().
> >
> > Move ->init_lock handling outside of __comp_algorithm_show()
> > (also drop it and call zcomp_available_show() directly) so that
> > the entire recomp_algorithm_show() loop is protected by the
> > lock, as opposed to protecting individual iterations.
>
> As always, I'm wondering "does -stable need this". But without knowing
> the runtime effects of the bug, I cannot know.
>
> Providing this info in the changelog would answer this for everyone, please.
Sure, Andrew.
The patch does not need to go to -stable, as it does not fix any
runtime errors (at least I can't think of any). It makes
recomp_algorithm_show() "atomic" w.r.t. zram reset() (just like
the rest of zram sysfs show() handlers), that's a pretty minor
change.
> > Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
> > Reported-by: Seyediman Seyedarab <imandevel@...il.com>
>
> And including a Closes: for Seyediman's report (if it's publicly
> linkable) would be great too, thanks.
>
> I'm guessing that a Fixes: isn't appropriate here because the
> bug has been there since day 1.
Yes, also there isn't really a public bug report there, I just noticed
that while looking at some things that Seyediman was looking at. So I
wanted to give Seyediman some credit. I suppose I probably should have
added
Suggested-by: Seyediman Seyedarab <imandevel@...il.com>
instead. Should I send a v2?
Powered by blists - more mailing lists