#syz test
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -976,7 +976,24 @@ int bch2_fsck_update_backpointers(struct btree_trans
*trans,
int ret = 0;
if (d->v.d_type == DT_SUBVOL) {
- BUG();
+ struct bch_subvolume subvol;
+
+ ret = bch2_subvolume_get(trans,
le32_to_cpu(d->v.d_child_subvol),
+ false, &subvol);
+ if (ret && !bch2_err_matches(ret, ENOENT))
+ goto err;
+
+ ret = get_visible_inodes(trans, &target, s,
le64_to_cpu(subvol.inode));
+ if (ret)
+ goto err;
+
+ if (target.inodes.nr) {
+ target.inodes.data[0].inode.bi_dir_offset =
d->k.p.offset;
+ ret = __bch2_fsck_write_inode(trans,
&target.inodes.data[0].inode);
+ if (ret)
+ goto err;
+ }
+
} else {
ret = get_visible_inodes(trans, &target, s,
le64_to_cpu(d->v.d_inum));
if (ret)
--
2.43.0- [syzbot] [bcachefs?] kernel BUG in __bch2_str_hash_check_k... syzbot
- Re: [syzbot] [bcachefs?] kernel BUG in __bch2_str_has... syzbot
- Sub volumes handling in bch2_fsck_update_backpoin... Arnaud Lecomte
- Re: Sub volumes handling in bch2_fsck_update_... Kent Overstreet
- Re: Sub volumes handling in bch2_fsck_upd... Arnaud Lecomte
- Re: Sub volumes handling in bch2_fsc... Kent Overstreet
- Re: Sub volumes handling in bch2... Arnaud Lecomte
- Re: [syzbot] [bcachefs?] kernel BUG in __bch2_str_has... syzbot
- syztest Arnaud Lecomte
- Re: syztest Kent Overstreet
- Re: [syzbot] [bcachefs?] kernel BUG in __bch2_str... syzbot
- Re: [syzbot] [bcachefs?] kernel BUG in __bch2_str_has... syzbot
