* [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
@ 2026-09-06 14:46 Deepanshu Kartikey
2026-09-07 4:51 ` Darrick J. Wong
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Deepanshu Kartikey @ 2026-09-06 14:46 UTC (permalink / raw)
To: cem, djwong
Cc: linux-xfs, linux-kernel, Deepanshu Kartikey, syzbot+ccdf3469f5f653bff7ac
__xfs_healthmon_insert() asserts that hm->lock is held
(lockdep_assert_held), but xfs_ioc_health_monitor() called it right
after allocating hm, before ever taking the lock, triggering a
lockdep warning.
Take hm->lock around the call.
Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
fs/xfs/xfs_healthmon.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c
index 3ae5f4496ad1..2f762f90d329 100644
--- a/fs/xfs/xfs_healthmon.c
+++ b/fs/xfs/xfs_healthmon.c
@@ -1219,7 +1219,9 @@ xfs_ioc_health_monitor(
}
running_event->type = XFS_HEALTHMON_RUNNING;
running_event->domain = XFS_HEALTHMON_MOUNT;
+ mutex_lock(&hm->lock);
__xfs_healthmon_insert(hm, running_event);
+ mutex_unlock(&hm->lock);
/*
* Preallocate the unmount event so that we can't fail to notify the
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-06 14:46 [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert Deepanshu Kartikey
@ 2026-09-07 4:51 ` Darrick J. Wong
2026-09-10 5:07 ` Christoph Hellwig
2026-09-10 9:11 ` Carlos Maiolino
2026-09-11 7:29 ` Carlos Maiolino
2 siblings, 1 reply; 10+ messages in thread
From: Darrick J. Wong @ 2026-09-07 4:51 UTC (permalink / raw)
To: Deepanshu Kartikey
Cc: cem, linux-xfs, linux-kernel, syzbot+ccdf3469f5f653bff7ac
On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> __xfs_healthmon_insert() asserts that hm->lock is held
> (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> after allocating hm, before ever taking the lock, triggering a
> lockdep warning.
>
> Take hm->lock around the call.
>
> Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Heh, I added a patch just like this one to my own tree.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_healthmon.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c
> index 3ae5f4496ad1..2f762f90d329 100644
> --- a/fs/xfs/xfs_healthmon.c
> +++ b/fs/xfs/xfs_healthmon.c
> @@ -1219,7 +1219,9 @@ xfs_ioc_health_monitor(
> }
> running_event->type = XFS_HEALTHMON_RUNNING;
> running_event->domain = XFS_HEALTHMON_MOUNT;
> + mutex_lock(&hm->lock);
> __xfs_healthmon_insert(hm, running_event);
> + mutex_unlock(&hm->lock);
>
> /*
> * Preallocate the unmount event so that we can't fail to notify the
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-07 4:51 ` Darrick J. Wong
@ 2026-09-10 5:07 ` Christoph Hellwig
2026-09-10 6:22 ` Carlos Maiolino
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Christoph Hellwig @ 2026-09-10 5:07 UTC (permalink / raw)
To: Darrick J. Wong
Cc: Deepanshu Kartikey, cem, linux-xfs, linux-kernel,
syzbot+ccdf3469f5f653bff7ac
On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
> On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> > __xfs_healthmon_insert() asserts that hm->lock is held
> > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> > after allocating hm, before ever taking the lock, triggering a
> > lockdep warning.
> >
> > Take hm->lock around the call.
> >
> > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
>
> Heh, I added a patch just like this one to my own tree.
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Can we get this queued up ASAP? It's also causing a lot of failures in
our zoned XFS CI.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-10 5:07 ` Christoph Hellwig
@ 2026-09-10 6:22 ` Carlos Maiolino
2026-09-10 6:23 ` Carlos Maiolino
2026-09-10 9:40 ` Carlos Maiolino
2 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-10 6:22 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, Deepanshu Kartikey, linux-xfs, linux-kernel,
syzbot+ccdf3469f5f653bff7ac
On Wed, Sep 09, 2026 at 10:07:56PM -0700, Christoph Hellwig wrote:
> On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
> > On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> > > __xfs_healthmon_insert() asserts that hm->lock is held
> > > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> > > after allocating hm, before ever taking the lock, triggering a
> > > lockdep warning.
> > >
> > > Take hm->lock around the call.
> > >
> > > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> > > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> > > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> > > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
> >
> > Heh, I added a patch just like this one to my own tree.
> > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>
> Can we get this queued up ASAP? It's also causing a lot of failures in
> our zoned XFS CI.
>
Yes, give me a few minutes and I'll have it today, ready for the next rc
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-10 5:07 ` Christoph Hellwig
2026-09-10 6:22 ` Carlos Maiolino
@ 2026-09-10 6:23 ` Carlos Maiolino
2026-09-10 9:40 ` Carlos Maiolino
2 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-10 6:23 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, Deepanshu Kartikey, linux-xfs, linux-kernel,
syzbot+ccdf3469f5f653bff7ac
On Wed, Sep 09, 2026 at 10:07:56PM -0700, Christoph Hellwig wrote:
> On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
> > On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> > > __xfs_healthmon_insert() asserts that hm->lock is held
> > > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> > > after allocating hm, before ever taking the lock, triggering a
> > > lockdep warning.
> > >
> > > Take hm->lock around the call.
> > >
> > > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> > > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> > > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> > > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
> >
> > Heh, I added a patch just like this one to my own tree.
> > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>
> Can we get this queued up ASAP? It's also causing a lot of failures in
> our zoned XFS CI.
>
>
Oh... this is actually already in my queue, I just need to push it :)
I'm just trying to get darricks attr fsblock fix in too because that is
also failing my own testing here.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-06 14:46 [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert Deepanshu Kartikey
2026-09-07 4:51 ` Darrick J. Wong
@ 2026-09-10 9:11 ` Carlos Maiolino
2026-09-11 7:29 ` Carlos Maiolino
2 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-10 9:11 UTC (permalink / raw)
To: djwong, Deepanshu Kartikey
Cc: linux-xfs, linux-kernel, syzbot+ccdf3469f5f653bff7ac
On Sun, 06 Sep 2026 20:16:29 +0530, Deepanshu Kartikey wrote:
> __xfs_healthmon_insert() asserts that hm->lock is held
> (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> after allocating hm, before ever taking the lock, triggering a
> lockdep warning.
>
> Take hm->lock around the call.
>
> [...]
Applied to for-next, thanks!
[1/1] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
commit: 4870da4f49ae2df4f804a6f770d56846e57495d7
Best regards,
--
Carlos Maiolino <cem@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-10 5:07 ` Christoph Hellwig
2026-09-10 6:22 ` Carlos Maiolino
2026-09-10 6:23 ` Carlos Maiolino
@ 2026-09-10 9:40 ` Carlos Maiolino
2026-09-10 13:42 ` Shigeru Yoshida
2 siblings, 1 reply; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-10 9:40 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Darrick J. Wong, Deepanshu Kartikey, linux-xfs, linux-kernel,
syzbot+ccdf3469f5f653bff7ac
On Wed, Sep 09, 2026 at 10:07:56PM -0700, Christoph Hellwig wrote:
> On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
> > On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> > > __xfs_healthmon_insert() asserts that hm->lock is held
> > > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> > > after allocating hm, before ever taking the lock, triggering a
> > > lockdep warning.
> > >
> > > Take hm->lock around the call.
> > >
> > > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> > > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> > > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> > > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
> >
> > Heh, I added a patch just like this one to my own tree.
> > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>
> Can we get this queued up ASAP? It's also causing a lot of failures in
> our zoned XFS CI.
>
>
Done. It's in for-next already. Not sure if I'll manage to push the
attrs fsblock fix yet this -rc, but this one will go to Linus on
Saturday
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-10 9:40 ` Carlos Maiolino
@ 2026-09-10 13:42 ` Shigeru Yoshida
2026-09-10 14:33 ` Carlos Maiolino
0 siblings, 1 reply; 10+ messages in thread
From: Shigeru Yoshida @ 2026-09-10 13:42 UTC (permalink / raw)
To: Carlos Maiolino
Cc: Christoph Hellwig, Darrick J. Wong, Deepanshu Kartikey,
linux-xfs, linux-kernel, syzbot+ccdf3469f5f653bff7ac
Carlos Maiolino <cem@kernel.org> writes:
> On Wed, Sep 09, 2026 at 10:07:56PM -0700, Christoph Hellwig wrote:
>> On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
>> > On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
>> > > __xfs_healthmon_insert() asserts that hm->lock is held
>> > > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
>> > > after allocating hm, before ever taking the lock, triggering a
>> > > lockdep warning.
>> > >
>> > > Take hm->lock around the call.
>> > >
>> > > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
>> > > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
>> > > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
>> > > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
>> >
>> > Heh, I added a patch just like this one to my own tree.
>> > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>>
>> Can we get this queued up ASAP? It's also causing a lot of failures in
>> our zoned XFS CI.
>>
>>
>
> Done. It's in for-next already. Not sure if I'll manage to push the
> attrs fsblock fix yet this -rc, but this one will go to Linus on
> Saturday
I noticed that the second mutex operation in this commit was
accidentally left as mutex_lock() instead of mutex_unlock(). I've
sent a fix as a separate patch ("xfs: fix double mutex_lock() call
in xfs_ioc_health_monitor()"). Feel free to use it if it helps.
Thanks,
Shigeru
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-10 13:42 ` Shigeru Yoshida
@ 2026-09-10 14:33 ` Carlos Maiolino
0 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-10 14:33 UTC (permalink / raw)
To: Shigeru Yoshida
Cc: Christoph Hellwig, Darrick J. Wong, Deepanshu Kartikey,
linux-xfs, linux-kernel, syzbot+ccdf3469f5f653bff7ac
On Thu, Sep 10, 2026 at 10:42:53PM +0900, Shigeru Yoshida wrote:
> Carlos Maiolino <cem@kernel.org> writes:
>
> > On Wed, Sep 09, 2026 at 10:07:56PM -0700, Christoph Hellwig wrote:
> >> On Sun, Sep 06, 2026 at 09:51:50PM -0700, Darrick J. Wong wrote:
> >> > On Sun, Sep 06, 2026 at 08:16:29PM +0530, Deepanshu Kartikey wrote:
> >> > > __xfs_healthmon_insert() asserts that hm->lock is held
> >> > > (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> >> > > after allocating hm, before ever taking the lock, triggering a
> >> > > lockdep warning.
> >> > >
> >> > > Take hm->lock around the call.
> >> > >
> >> > > Fixes: b3a289a2a9397 ("xfs: create event queuing, formatting, and discovery infrastructure")
> >> > > Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
> >> > > Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
> >> > > Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
> >> >
> >> > Heh, I added a patch just like this one to my own tree.
> >> > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
> >>
> >> Can we get this queued up ASAP? It's also causing a lot of failures in
> >> our zoned XFS CI.
> >>
> >>
> >
> > Done. It's in for-next already. Not sure if I'll manage to push the
> > attrs fsblock fix yet this -rc, but this one will go to Linus on
> > Saturday
>
> I noticed that the second mutex operation in this commit was
> accidentally left as mutex_lock() instead of mutex_unlock(). I've
> sent a fix as a separate patch ("xfs: fix double mutex_lock() call
> in xfs_ioc_health_monitor()"). Feel free to use it if it helps.
Thanks for the info, something went pretty wrong with b4. I didn't touch
the patch manually and somehow it got twisted when I pulled it.
I'll figure it out what went wrong but first let me fix this...
This shouldn't be in the tree at all, so I'll remove the patch for now
as this has not been pulled into the linux-next.
>
> Thanks,
> Shigeru
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
2026-09-06 14:46 [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert Deepanshu Kartikey
2026-09-07 4:51 ` Darrick J. Wong
2026-09-10 9:11 ` Carlos Maiolino
@ 2026-09-11 7:29 ` Carlos Maiolino
2 siblings, 0 replies; 10+ messages in thread
From: Carlos Maiolino @ 2026-09-11 7:29 UTC (permalink / raw)
To: djwong, Deepanshu Kartikey
Cc: linux-xfs, linux-kernel, syzbot+ccdf3469f5f653bff7ac
On Sun, 06 Sep 2026 20:16:29 +0530, Deepanshu Kartikey wrote:
> __xfs_healthmon_insert() asserts that hm->lock is held
> (lockdep_assert_held), but xfs_ioc_health_monitor() called it right
> after allocating hm, before ever taking the lock, triggering a
> lockdep warning.
>
> Take hm->lock around the call.
>
> [...]
Applied to for-next, thanks!
[1/1] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
commit: e240919ca727776f16a468d3d90686dc82cfe9cb
Best regards,
--
Carlos Maiolino <cem@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-09-11 7:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06 14:46 [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert Deepanshu Kartikey
2026-09-07 4:51 ` Darrick J. Wong
2026-09-10 5:07 ` Christoph Hellwig
2026-09-10 6:22 ` Carlos Maiolino
2026-09-10 6:23 ` Carlos Maiolino
2026-09-10 9:40 ` Carlos Maiolino
2026-09-10 13:42 ` Shigeru Yoshida
2026-09-10 14:33 ` Carlos Maiolino
2026-09-10 9:11 ` Carlos Maiolino
2026-09-11 7:29 ` Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®