]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Clear fs_path_parent on subvolume unlink
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 29 Mar 2025 21:59:50 +0000 (17:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 30 Mar 2025 00:16:49 +0000 (20:16 -0400)
This fixes recursive subvolume removal.

Subvolume deletion is asynchronous; fs_path_parent, and thus the entry
in the subvolume_children btree, need to be cleared when the subvolume
is unlinked from the fs heirarchy - else we'll spuriously think a
subvolume has children and deletion will fail.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/subvolume.c

index b7b96283c3161d9b2921a9c5d0c37d457407c3b5..cd0d8e5e44e7909b102f3c21dd763d5896848200 100644 (file)
@@ -561,6 +561,7 @@ int bch2_subvolume_unlink(struct btree_trans *trans, u32 subvolid)
        }
 
        SET_BCH_SUBVOLUME_UNLINKED(&n->v, true);
+       n->v.fs_path_parent = 0;
        bch2_trans_iter_exit(trans, &iter);
        return ret;
 }