diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-21 03:50:07 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:14 +0300 |
commit | 521b80676927df6b4ad4fc87b7756aad43b96d12 (patch) | |
tree | 69ad74a5467511428f1d1c1fa18d7e1cafaea279 /fs | |
parent | 6e0c886d3ccd81d87054269b96de6e4eb6ba0edd (diff) | |
download | linux-521b80676927df6b4ad4fc87b7756aad43b96d12.tar.xz |
bcachefs: Delete dentry when deleting snapshots
This fixes a bug where subsequently doing creates with the same name
fails.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/fs-ioctl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c index ae402d350d4c..a12b591ec9ca 100644 --- a/fs/bcachefs/fs-ioctl.c +++ b/fs/bcachefs/fs-ioctl.c @@ -422,6 +422,7 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp, struct bch_ioctl_subvolume arg) { struct path path; + struct inode *dir; int ret = 0; if (arg.flags) @@ -438,7 +439,13 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp, return -EXDEV; } - ret = __bch2_unlink(path.dentry->d_parent->d_inode, path.dentry, 1); + dir = path.dentry->d_parent->d_inode; + + ret = __bch2_unlink(dir, path.dentry, 1); + if (!ret) { + fsnotify_rmdir(dir, path.dentry); + d_delete(path.dentry); + } path_put(&path); return ret; |