diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-08 19:52:37 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-13 21:22:24 -0400 |
commit | f5d58d0c7212adc02b40dc4b7f6c9ebfde685d1c (patch) | |
tree | 9a24d0d4061e060dbfa9a17944ee4731b12fc59d /fs/bcachefs/fsck.c | |
parent | 64304aaf4ef3d14c46d711a35a7b78bb5790350a (diff) | |
download | linux-stable-f5d58d0c7212adc02b40dc4b7f6c9ebfde685d1c.tar.gz linux-stable-f5d58d0c7212adc02b40dc4b7f6c9ebfde685d1c.tar.bz2 linux-stable-f5d58d0c7212adc02b40dc4b7f6c9ebfde685d1c.zip |
bcachefs: Fix path where dirent -> subvol missing and we don't fix
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 0d405b960a7c..27bf07000baa 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -1765,10 +1765,14 @@ static int check_dirent_to_subvol(struct btree_trans *trans, struct btree_iter * if (ret && !bch2_err_matches(ret, ENOENT)) return ret; - if (fsck_err_on(ret, c, dirent_to_missing_subvol, - "dirent points to missing subvolume\n%s", - (bch2_bkey_val_to_text(&buf, c, d.s_c), buf.buf))) - return __remove_dirent(trans, d.k->p); + if (ret) { + if (fsck_err(c, dirent_to_missing_subvol, + "dirent points to missing subvolume\n%s", + (bch2_bkey_val_to_text(&buf, c, d.s_c), buf.buf))) + return __remove_dirent(trans, d.k->p); + ret = 0; + goto out; + } ret = lookup_inode(trans, target_inum, &subvol_root, &target_snapshot); @@ -1790,6 +1794,7 @@ static int check_dirent_to_subvol(struct btree_trans *trans, struct btree_iter * target_snapshot); if (ret) return ret; +out: err: fsck_err: printbuf_exit(&buf); |