summaryrefslogtreecommitdiff
path: root/libbcachefs/fs-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/fs-ioctl.c')
-rw-r--r--libbcachefs/fs-ioctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbcachefs/fs-ioctl.c b/libbcachefs/fs-ioctl.c
index 3ed53f42..513f7a7a 100644
--- a/libbcachefs/fs-ioctl.c
+++ b/libbcachefs/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;