mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+820dc3b465c69f766a57@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bcachefs?] INFO: task hung in bch2_journal_reclaim_thread (2)
Date: Sat, 26 Oct 2024 12:50:31 +0800	[thread overview]
Message-ID: <tencent_8AD1777367243C273694968636624A487409@qq.com> (raw)
In-Reply-To: <66f872a0.050a0220.4a974.000f.GAE@google.com>

avoid race conditions when journal's reclaim and flush acquire reclaim_lock

#syz test

diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c
index ace291f175dd..58a745c72aac 100644
--- a/fs/bcachefs/journal_reclaim.c
+++ b/fs/bcachefs/journal_reclaim.c
@@ -731,7 +731,7 @@ static int bch2_journal_reclaim_thread(void *arg)
 
 	j->last_flushed = jiffies;
 
-	while (!ret && !kthread_should_stop()) {
+	while (!j->flush_in_progress && !ret && !kthread_should_stop()) {
 		bool kicked = j->reclaim_kicked;
 
 		j->reclaim_kicked = false;


  reply	other threads:[~2024-10-26  4:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21  8:21 syzbot
2024-09-28 21:18 ` syzbot
2024-10-26  4:50   ` Edward Adam Davis [this message]
2024-10-26  5:18     ` syzbot
2024-09-29  7:28 ` 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=tencent_8AD1777367243C273694968636624A487409@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+820dc3b465c69f766a57@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 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®