All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuto Ohnuki <ytohnuki@amazon.com>
To: <syzbot+c27dee924f3271489c82@syzkaller.appspotmail.com>
Cc: <linux-xfs@vger.kernel.org>, <syzkaller-bugs@googlegroups.com>,
	"Yuto Ohnuki" <ytohnuki@amazon.com>
Subject: Re: [syzbot] [xfs?] INFO: task hung in xlog_force_lsn (2)
Date: Mon, 13 Apr 2026 07:19:18 +0100	[thread overview]
Message-ID: <20260413061917.18327-2-ytohnuki@amazon.com> (raw)
In-Reply-To: <68e9715b.050a0220.1186a4.000e.GAE@google.com>

#syz test

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index f807f8f4f705..2645052042bf 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -426,6 +426,23 @@ xlog_state_shutdown_callbacks(
 	struct xlog_in_core	*iclog;
 	LIST_HEAD(cb_list);
 
+	/*
+	 * Shutdown waiters on ic_force_wait do not require callback completion.
+	 * Once log shutdown has been established, they only need to wake,
+	 * observe xlog_is_shutdown(), and abort with -EIO.
+	 *
+	 * Wake them before processing callbacks to avoid deadlock if callback
+	 * processing blocks on a buffer lock and prevents the wakeup from being
+	 * reached.
+	 *
+	 * Keep ic_write_wait wakeups ordered after callback processing so
+	 * shutdown callback side effects still complete before teardown progresses.
+	 */
+	iclog = log->l_iclog;
+	do {
+		wake_up_all(&iclog->ic_force_wait);
+	} while ((iclog = iclog->ic_next) != log->l_iclog);
+
 	iclog = log->l_iclog;
 	do {
 		if (atomic_read(&iclog->ic_refcnt)) {
@@ -439,7 +456,6 @@ xlog_state_shutdown_callbacks(
 
 		spin_lock(&log->l_icloglock);
 		wake_up_all(&iclog->ic_write_wait);
-		wake_up_all(&iclog->ic_force_wait);
 	} while ((iclog = iclog->ic_next) != log->l_iclog);
 
 	wake_up_all(&log->l_flush_wait);
-- 
2.50.1




Amazon Web Services EMEA SARL, 38 avenue John F. Kennedy, L-1855 Luxembourg, R.C.S. Luxembourg B186284

Amazon Web Services EMEA SARL, Irish Branch, One Burlington Plaza, Burlington Road, Dublin 4, Ireland, branch registration number 908705




  reply	other threads:[~2026-04-13  6:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 20:49 [syzbot] [xfs?] INFO: task hung in xlog_force_lsn (2) syzbot
2026-04-13  6:19 ` Yuto Ohnuki [this message]
2026-04-13  6:38   ` syzbot
2026-04-13  6:19 ` Forwarded: " syzbot
2026-04-13  8:06 ` Yuto Ohnuki
2026-04-13  8:29   ` syzbot
2026-04-13  8:06 ` Forwarded: " syzbot

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=20260413061917.18327-2-ytohnuki@amazon.com \
    --to=ytohnuki@amazon.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=syzbot+c27dee924f3271489c82@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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.