Skip to content

Commit 01d925f

Browse files
nathanchanceKent Overstreet
authored andcommitted
bcachefs: Fix -Wc23-extensions in bch2_check_dirents()
Clang warns (or errors with CONFIG_WERROR=y): fs/bcachefs/fsck.c:2325:2: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions] 2325 | int ret = bch2_trans_run(c, | ^ On clang-17 and older, this is an unconditional error: fs/bcachefs/fsck.c:2325:2: error: expected expression 2325 | int ret = bch2_trans_run(c, | ^ Move the declaration of ret to the top of the function to resolve both ways this issue manifests. Fixes: c72def5 ("bcachefs: Run check_dirents second time if required") Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent c72def5 commit 01d925f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/bcachefs/fsck.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,10 +2313,11 @@ int bch2_check_dirents(struct bch_fs *c)
23132313
struct snapshots_seen s;
23142314
struct bch_hash_info hash_info;
23152315
bool need_second_pass = false, did_second_pass = false;
2316+
int ret;
23162317

23172318
snapshots_seen_init(&s);
23182319
again:
2319-
int ret = bch2_trans_run(c,
2320+
ret = bch2_trans_run(c,
23202321
for_each_btree_key_commit(trans, iter, BTREE_ID_dirents,
23212322
POS(BCACHEFS_ROOT_INO, 0),
23222323
BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k,

0 commit comments

Comments
 (0)