From: Kent Overstreet <kent.overstreet@linux.dev>
To: linux-bcachefs@vger.kernel.org
Cc: Kent Overstreet <kent.overstreet@linux.dev>,
syzbot+3168625f36f4a539237e@syzkaller.appspotmail.com
Subject: [PATCH 6/7] bcachefs: Fix reference to invalid bucket in copygc
Date: Wed, 16 Jul 2025 12:01:40 -0400 [thread overview]
Message-ID: <20250716160141.1158722-6-kent.overstreet@linux.dev> (raw)
In-Reply-To: <20250716160141.1158722-1-kent.overstreet@linux.dev>
Use bch2_dev_bucket_tryget() instead of bch2_dev_tryget() before
checking the bucket bitmap.
Reported-by: syzbot+3168625f36f4a539237e@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
fs/bcachefs/movinggc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index 27e68d470ad0..5e6de91a8763 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -71,7 +71,7 @@ static int bch2_bucket_is_movable(struct btree_trans *trans,
if (ret)
return ret;
- struct bch_dev *ca = bch2_dev_tryget(c, k.k->p.inode);
+ struct bch_dev *ca = bch2_dev_bucket_tryget(c, k.k->p);
if (!ca)
goto out;
--
2.50.0
next prev parent reply other threads:[~2025-07-16 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 16:01 [PATCH 1/7] bcachefs: io_read: remove from async obj list in rbio_done() Kent Overstreet
2025-07-16 16:01 ` [PATCH 2/7] bcachefs: async_objs: update iter pos after obj printed Kent Overstreet
2025-07-16 16:01 ` [PATCH 3/7] bcachefs: Fix triggering of discard by the journal path Kent Overstreet
2025-07-16 16:01 ` [PATCH 4/7] bcachefs: Tweak threshold for allocator triggering discards Kent Overstreet
2025-07-16 16:01 ` [PATCH 5/7] bcachefs: Don't build aux search tree when still repairing node Kent Overstreet
2025-07-16 16:01 ` Kent Overstreet [this message]
2025-07-16 16:01 ` [PATCH 7/7] bcachefs: Fix build when CONFIG_UNICODE=n Kent Overstreet
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=20250716160141.1158722-6-kent.overstreet@linux.dev \
--to=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=syzbot+3168625f36f4a539237e@syzkaller.appspotmail.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;
as well as URLs for NNTP newsgroup(s).