Skip to content

Commit 8060bf1

Browse files
author
Kent Overstreet
committed
bcachefs: Fix snapshot_t() usage in bch2_fs_quota_read_inode()
bch2_fs_quota_read_inode() wasn't entirely updated to the bch2_snapshot_tree() helper, which takes rcu lock. Reported-by: [email protected] Signed-off-by: Kent Overstreet <[email protected]>
1 parent 0ec5b3b commit 8060bf1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fs/bcachefs/quota.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,13 +560,11 @@ static int bch2_fs_quota_read_inode(struct btree_trans *trans,
560560
struct bch_fs *c = trans->c;
561561
struct bch_inode_unpacked u;
562562
struct bch_snapshot_tree s_t;
563-
int ret;
563+
u32 tree = bch2_snapshot_tree(c, k.k->p.snapshot);
564564

565-
ret = bch2_snapshot_tree_lookup(trans,
566-
bch2_snapshot_tree(c, k.k->p.snapshot), &s_t);
565+
int ret = bch2_snapshot_tree_lookup(trans, tree, &s_t);
567566
bch2_fs_inconsistent_on(bch2_err_matches(ret, ENOENT), c,
568-
"%s: snapshot tree %u not found", __func__,
569-
snapshot_t(c, k.k->p.snapshot)->tree);
567+
"%s: snapshot tree %u not found", __func__, tree);
570568
if (ret)
571569
return ret;
572570

0 commit comments

Comments
 (0)