From: Andreas Gruenbacher <agruenba@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: cgroups@vger.kernel.org, Jan Kara <jack@suse.cz>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Rafael Aquini <aquini@redhat.com>, gfs2 <gfs2@lists.linux.dev>,
Linux-MM <linux-mm@kvack.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] writeback: Fix false warning in inode_to_wb()
Date: Tue, 15 Apr 2025 01:18:38 +0200 [thread overview]
Message-ID: <CAHc6FU5EMw_S4FHyBLRinTdDc-jh9WPOnabSdvHuVF_MPWQkMw@mail.gmail.com> (raw)
In-Reply-To: <20250414144741.56f7e4162c5faa9f3fb5c2a6@linux-foundation.org>
On Mon, Apr 14, 2025 at 11:47 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Sat, 12 Apr 2025 18:39:12 +0200 Andreas Gruenbacher <agruenba@redhat.com> wrote:
> > From: Jan Kara <jack@suse.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
next prev parent reply other threads:[~2025-04-14 23:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-12 16:39 [PATCH v3 0/2] Fix false warning in inode_to_wb Andreas Gruenbacher
2025-04-12 16:39 ` [PATCH v3 1/2] gfs2: replace sd_aspace with sd_inode Andreas Gruenbacher
2025-04-12 16:39 ` [PATCH v3 2/2] writeback: Fix false warning in inode_to_wb() Andreas Gruenbacher
2025-04-14 13:55 ` Jan Kara
2025-04-14 21:47 ` Andrew Morton
2025-04-14 23:18 ` Andreas Gruenbacher [this message]
2025-04-14 21:51 ` Andrew Morton
2025-04-14 23:22 ` Andreas Gruenbacher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHc6FU5EMw_S4FHyBLRinTdDc-jh9WPOnabSdvHuVF_MPWQkMw@mail.gmail.com \
--to=agruenba@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aquini@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=gfs2@lists.linux.dev \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox