Commit e1e7ecaf authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Improve error handling in bch2_ioctl_subvolume_destroy()

Pure style fixes
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2d33036c
...@@ -451,19 +451,20 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp, ...@@ -451,19 +451,20 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp,
return ret; return ret;
if (path.dentry->d_sb->s_fs_info != c) { if (path.dentry->d_sb->s_fs_info != c) {
path_put(&path); ret = -EXDEV;
return -EXDEV; goto err;
} }
dir = path.dentry->d_parent->d_inode; dir = path.dentry->d_parent->d_inode;
ret = __bch2_unlink(dir, path.dentry, true); ret = __bch2_unlink(dir, path.dentry, true);
if (!ret) { if (ret)
fsnotify_rmdir(dir, path.dentry); goto err;
d_delete(path.dentry);
}
path_put(&path);
fsnotify_rmdir(dir, path.dentry);
d_delete(path.dentry);
err:
path_put(&path);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment