]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/fs-ioctl.c
Update bcachefs sources to 5e392aed7a bcachefs: Kill bch2_alloc_write()
[bcachefs-tools-debian] / libbcachefs / fs-ioctl.c
index 3ed53f420e7e713d6b8d51a19bc42d604610a61a..9f329a624c1270628aa4732b0de530bdd1b57056 100644 (file)
@@ -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, true);
+       if (!ret) {
+               fsnotify_rmdir(dir, path.dentry);
+               d_delete(path.dentry);
+       }
        path_put(&path);
 
        return ret;