bcachefs: Fix __bch2_dirent_read_target()
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 14 Oct 2021 17:14:40 +0000 (13:14 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:14 +0000 (17:09 -0400)
We were shadowing our exist status, oops

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/dirent.c

index c7344ac87fcd894ca6c1c461d29780cb7737401f..cd5468b15ba26956a2072c0257e57f5a03093099 100644 (file)
@@ -183,6 +183,7 @@ int __bch2_dirent_read_target(struct btree_trans *trans,
                              u32 *subvol, u32 *snapshot, u64 *inum,
                              bool is_fsck)
 {
+       struct bch_subvolume s;
        int ret = 0;
 
        *subvol         = 0;
@@ -191,9 +192,6 @@ int __bch2_dirent_read_target(struct btree_trans *trans,
        if (likely(d.v->d_type != DT_SUBVOL)) {
                *inum = le64_to_cpu(d.v->d_inum);
        } else {
-               struct bch_subvolume s;
-               int ret;
-
                *subvol = le64_to_cpu(d.v->d_inum);
 
                ret = bch2_subvolume_get(trans, *subvol, !is_fsck, BTREE_ITER_CACHED, &s);