mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shigeru Yoshida <syoshida@redhat.com>
To: Carlos Maiolino <cem@kernel.org>,
	Deepanshu Kartikey <kartikey406@gmail.com>,
	"Darrick J. Wong" <djwong@kernel.org>
Cc: Shigeru Yoshida <syoshida@redhat.com>,
	linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] xfs: fix double mutex_lock() call in xfs_ioc_health_monitor()
Date: Thu, 10 Sep 2026 22:29:55 +0900	[thread overview]
Message-ID: <20260910132956.538828-1-syoshida@redhat.com> (raw)

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.

Fixes: 4870da4f49ae ("xfs: take hm->lock in xfs_ioc_health_monitor() before insert")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
---
 fs/xfs/xfs_healthmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c
index 6dc3f69d6798..c3749675ef19 100644
--- a/fs/xfs/xfs_healthmon.c
+++ b/fs/xfs/xfs_healthmon.c
@@ -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
-- 
2.55.0


             reply	other threads:[~2026-09-10 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 13:29 Shigeru Yoshida [this message]
2026-09-10 14:57 ` Darrick J. Wong
2026-09-10 15:12   ` Carlos Maiolino

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=20260910132956.538828-1-syoshida@redhat.com \
    --to=syoshida@redhat.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=kartikey406@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®