xfs: fix double mutex_lock() call in xfs_ioc_health_monitor()
PATCH 1/1 xfs: fix double mutex_lock() call in xfs_ioc_health_monitor()
Commit 4870da4f49ae ("xfs: take hm->lock in xfs_ioc_health_monitor() before insert") intended to protect the __xfs_healthmon_insert() call with hm->lock, but the second mutex operation was accidentally left as mutex_lock() instead of mutex_unlock(), causing self-deadlock. Change the second call to mutex_unlock() as originally intended.
--- fs/xfs/xfs_healthmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_healthmon.c +1 -1
@@ -1225,7 +1225,7 @@ xfs_ioc_health_monitor( running_event->domain =XFS_HEALTHMON_MOUNT ;mutex_lock (&hm->lock);__xfs_healthmon_insert (hm,INSERT_HEAD , running_event); -mutex_lock (&hm->lock); +mutex_unlock (&hm->lock);/* * Preallocate the unmount event so that we can't fail to notify the
Signature · 1 line
2.55.0
Quoted 8 lines · Shigeru Yoshida
Commit
4870da4f49ae("xfs: takehm->lockinxfs_ioc_health_monitor()before insert") intended to protect the__xfs_healthmon_insert()call withhm->lock, but the second mutex operation was accidentally left asmutex_lock()instead ofmutex_unlock(), causing self-deadlock. Change the second call tomutex_unlock()as originally intended.Fixes 4870da4f49ae ("xfs: take hm->lock in xfs_ioc_health_monitor() before insert")Signed-off-by Shigeru Yoshida <[email protected]>
The original patch I reviewed unlocked hm->lock correctly, not sure how it got corrupted by the tooling such that we need this. I think cem fixed it already(?) but in case anyone needs it,
--D
Quoted 21 lines
--- fs/xfs/xfs_healthmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_healthmon.c +1
-1@@ -1225,7 +1225,7 @@ xfs_ioc_health_monitor( running_event->domain =XFS_HEALTHMON_MOUNT ;mutex_lock (&hm->lock);__xfs_healthmon_insert (hm,INSERT_HEAD , running_event); -mutex_lock (&hm->lock); +mutex_unlock (&hm->lock);/* * Preallocate the unmount event so that we can't fail to notify the Signature · 1 line
2.55.0
Carlos Maiolino
maintainerQuoted 7 lines · Darrick J. Wong
Quoted 6 lines · Shigeru Yoshida
Commit
4870da4f49ae("xfs: takehm->lockinxfs_ioc_health_monitor()before insert") intended to protect the__xfs_healthmon_insert()call withhm->lock, but the second mutex operation was accidentally left asmutex_lock()instead ofmutex_unlock(), causing self-deadlock. Change the second call tomutex_unlock()as originally intended.
Quoted 6 lines
Quoted 2 lines
Fixes 4870da4f49ae ("xfs: take hm->lock in xfs_ioc_health_monitor() before insert")Signed-off-by Shigeru Yoshida <[email protected]>The original patch I reviewed unlocked
hm->lockcorrectly, not sure how it got corrupted by the tooling such that we need this. I think cem fixed it already(?) but in case anyone needs it,
yes, it's fixed already... I had not a single clue what happened, I haven't changed any patch manually on this batch, might have been the tooling with some weird fuzz to fix context conflicts, but most likely I screwed up somewhere.
Whatever the reason, this is on me for not having double-checked the result once I pulled the patches in, so I'm really sorry for that.
And thanks again Yoshida for having spotted it.
Quoted 27 lines
Reviewed-by "Darrick J. Wong" <[email protected]>--D
Quoted 21 lines
--- fs/xfs/xfs_healthmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_healthmon.c +1
-1@@ -1225,7 +1225,7 @@ xfs_ioc_health_monitor( running_event->domain =XFS_HEALTHMON_MOUNT ;mutex_lock (&hm->lock);__xfs_healthmon_insert (hm,INSERT_HEAD , running_event); -mutex_lock (&hm->lock); +mutex_unlock (&hm->lock);/* * Preallocate the unmount event so that we can't fail to notify the Signature · 1 line
2.55.0