summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/dirent.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-09 21:01:04 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-13 21:22:24 -0400
commit835cd3e147a9a8f8acfe7f3a405c582f04e90a33 (patch)
treef83176bf70467c09faf943578cc48bcb72247299 /fs/bcachefs/dirent.c
parentb26d79147f5ffaeabbda1cad556761965d6d85fe (diff)
downloadlinux-stable-835cd3e147a9a8f8acfe7f3a405c582f04e90a33.tar.gz
linux-stable-835cd3e147a9a8f8acfe7f3a405c582f04e90a33.tar.bz2
linux-stable-835cd3e147a9a8f8acfe7f3a405c582f04e90a33.zip
bcachefs: Check for subvolume children when deleting subvolumes
Recursively destroying subvolumes isn't allowed yet. Fixes: https://github.com/koverstreet/bcachefs/issues/634 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/dirent.c')
-rw-r--r--fs/bcachefs/dirent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c
index 882b2a217b51..d37bd07afbfe 100644
--- a/fs/bcachefs/dirent.c
+++ b/fs/bcachefs/dirent.c
@@ -525,7 +525,7 @@ int bch2_empty_dir_snapshot(struct btree_trans *trans, u64 dir, u32 subvol, u32
struct bkey_s_c_dirent d = bkey_s_c_to_dirent(k);
if (d.v->d_type == DT_SUBVOL && le32_to_cpu(d.v->d_parent_subvol) != subvol)
continue;
- ret = -ENOTEMPTY;
+ ret = -BCH_ERR_ENOTEMPTY_dir_not_empty;
break;
}
bch2_trans_iter_exit(trans, &iter);