All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <chao@kernel.org>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH v2 1/1] f2fs: fix lockdep WARN of sbi->cp_global_sem and q->q_usage_counter
Date: Thu, 5 Mar 2026 01:52:47 +0000	[thread overview]
Message-ID: <aajhnCU8KjUaoCl_@shinmob> (raw)
In-Reply-To: <cb8b545f-0bbc-4747-a2ce-7432fa1e6ef2@kernel.org>

On Mar 05, 2026 / 09:38, Chao Yu wrote:
> On 2026/3/4 16:55, Chao Yu wrote:
> > On 2026/3/4 12:57, Shinichiro Kawasaki wrote:
[...]
> > > I will seek out other ways to avoid the lockdep. I have no idea how to do that
> > > at this moment, though.
> > 
> > Shinichiro,
> > 
> > IMO, this looks like a false alarm of lockdep, what do you think of this fix?
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/commit/?h=bugfix/syzbot&id=3b19564b95e9ba9803ef30e90eace0977b9d140d
> > 
> > ---
> >   fs/f2fs/f2fs.h  | 3 +++
> >   fs/f2fs/super.c | 3 +++
> >   2 files changed, 6 insertions(+)
> > 
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index bb34e864d0ef..5b400e99f332 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -2042,6 +2042,9 @@ struct f2fs_sb_info {
> >          spinlock_t iostat_lat_lock;
> >          struct iostat_lat_info *iostat_io_lat;
> >   #endif
> > +#ifdef CONFIG_DEBUG_LOCK_ALLOC
> > +       struct lock_class_key cp_global_sem_key;
> > +#endif
> >   };
> > 
> >   /* Definitions to access f2fs_sb_info */
> > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> > index 8774c60b4be4..9e85f31fa828 100644
> > --- a/fs/f2fs/super.c
> > +++ b/fs/f2fs/super.c
> > @@ -4948,6 +4948,9 @@ static int f2fs_fill_super(struct super_block *sb, struct fs_context *fc)
> >          init_f2fs_rwsem_trace(&sbi->gc_lock, sbi, LOCK_NAME_GC_LOCK);
> >          mutex_init(&sbi->writepages);
> >          init_f2fs_rwsem_trace(&sbi->cp_global_sem, sbi, LOCK_NAME_CP_GLOBAL);
> > +#ifdef CONFIG_DEBUG_LOCK_ALLOC
> > +       lockdep_set_class(&sbi->cp_global_sem, &sbi->cp_global_sem_key);
> 
> Sorry, should be:
> 
> +	lockdep_set_class(&sbi->cp_global_sem.internal_rwsem,
> +					&sbi->cp_global_sem_key);
> 
> Thanks,

Chao, thank you very much for the idea and the trial patch! I will try it out.
Let me have a day or two.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2026-03-05  1:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 12:52 [f2fs-dev] [PATCH v2 0/1] f2fs: fix lockdep WARN of sbi->cp_global_sem and q->q_usage_counter Shin'ichiro Kawasaki via Linux-f2fs-devel
2026-02-18 12:52 ` [f2fs-dev] [PATCH v2 1/1] " Shin'ichiro Kawasaki via Linux-f2fs-devel
2026-02-24  3:26   ` Jaegeuk Kim via Linux-f2fs-devel
2026-02-24  6:28     ` Shinichiro Kawasaki via Linux-f2fs-devel
2026-02-27 20:32       ` Jaegeuk Kim via Linux-f2fs-devel
2026-03-04  4:57         ` Shinichiro Kawasaki via Linux-f2fs-devel
2026-03-04  8:55           ` Chao Yu via Linux-f2fs-devel
2026-03-05  1:38             ` Chao Yu via Linux-f2fs-devel
2026-03-05  1:52               ` Shinichiro Kawasaki via Linux-f2fs-devel [this message]
2026-03-05  2:03                 ` Chao Yu via Linux-f2fs-devel
2026-03-05  8:49                   ` Shinichiro Kawasaki via Linux-f2fs-devel
2026-03-06 12:18                     ` Chao Yu via Linux-f2fs-devel

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=aajhnCU8KjUaoCl_@shinmob \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.