[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHc6FU5EMw_S4FHyBLRinTdDc-jh9WPOnabSdvHuVF_MPWQkMw@mail.gmail.com>
Date: Tue, 15 Apr 2025 01:18:38 +0200
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: cgroups@...r.kernel.org, Jan Kara <jack@...e.cz>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>, Rafael Aquini <aquini@...hat.com>,
gfs2 <gfs2@...ts.linux.dev>, Linux-MM <linux-mm@...ck.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] writeback: Fix false warning in inode_to_wb()
On Mon, Apr 14, 2025 at 11:47 PM Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Sat, 12 Apr 2025 18:39:12 +0200 Andreas Gruenbacher <agruenba@...hat.com> wrote:
> > From: Jan Kara <jack@...e.cz>
> >
> > inode_to_wb() is used also for filesystems that don't support cgroup
> > writeback. For these filesystems inode->i_wb is stable during the
> > lifetime of the inode (it points to bdi->wb) and there's no need to hold
> > locks protecting the inode->i_wb dereference. Improve the warning in
> > inode_to_wb() to not trigger for these filesystems.
> >
> > ...
> >
> > --- a/include/linux/backing-dev.h
> > +++ b/include/linux/backing-dev.h
> > @@ -249,6 +249,7 @@ static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
> > {
> > #ifdef CONFIG_LOCKDEP
> > WARN_ON_ONCE(debug_locks &&
> > + (inode->i_sb->s_iflags & SB_I_CGROUPWB) &&
> > (!lockdep_is_held(&inode->i_lock) &&
> > !lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
> > !lockdep_is_held(&inode->i_wb->list_lock)));
>
> Is this a does-nothing now GFS2 has been altered?
>
> Otherwise, a bogus WARN is something we'll want to eliminate from
> -stable kernels also. Are we able to identify a Fixes: for this?
The excess warnings started with commit:
Fixes: aaa2cacf8184 ("writeback: add lockdep annotation to inode_to_wb()")
Getting rid of them requires this change, together with "gfs2: replace
sd_aspace with sd_inode" from gfs2 for-next:
https://web.git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/commit/?h=
a5fb828aba730d08aa6dec6bce3839f25e1f7a9d
Thanks,
Andreas
Powered by blists - more mailing lists