This fixes a bug where subsequently doing creates with the same name
fails.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
struct bch_ioctl_subvolume arg)
{
struct path path;
+ struct inode *dir;
int ret = 0;
if (arg.flags)
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;