[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_4A8FBB4133EA9E461B0C4B2C1B2425FFBA08@qq.com>
Date: Wed, 25 Sep 2024 21:53:00 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+c0360e8367d6d8d04a66@...kaller.appspotmail.com
Cc: brauner@...nel.org,
jack@...e.cz,
jfs-discussion@...ts.sourceforge.net,
kent.overstreet@...ux.dev,
linux-bcachefs@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
shaggy@...nel.org,
syzkaller-bugs@...glegroups.com,
viro@...iv.linux.org.uk
Subject: [PATCH] bcachefs: return the error code instead of the return value of IS_ERR_OR_NULL
Syzbot report a kernel BUG in vfs_get_tree.
The root cause is that read_btree_nodes() returned 1 and returned -EINTR
due to kthread_run() execution failure.
The -EINTR needs to be returnned to bch2_fs_recovery(), not return to
"ret = IS_ERR_OR_NULL(t)".
Reported-and-tested-by: syzbot+c0360e8367d6d8d04a66@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c0360e8367d6d8d04a66
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
fs/bcachefs/btree_node_scan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/bcachefs/btree_node_scan.c b/fs/bcachefs/btree_node_scan.c
index b28c649c6838..df7090ca1e81 100644
--- a/fs/bcachefs/btree_node_scan.c
+++ b/fs/bcachefs/btree_node_scan.c
@@ -281,6 +281,10 @@ static int read_btree_nodes(struct find_btree_nodes *f)
closure_put(&cl);
f->ret = ret;
bch_err(c, "error starting kthread: %i", ret);
+ if (IS_ERR(t)) {
+ closure_sync(&cl);
+ return PTR_ERR(t);
+ }
break;
}
}
--
2.43.0
Powered by blists - more mailing lists