diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-16 17:47:35 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:57 +0200 |
commit | e1e7ecafe6482464ccc510afb38e1b9b306ce5dc (patch) | |
tree | 93facd49124c85556ca4058948de21934af193cc /fs/bcachefs/fs-ioctl.c | |
parent | bcachefs: Fix for 'missing subvolume' error (diff) | |
download | linux-e1e7ecafe6482464ccc510afb38e1b9b306ce5dc.tar.xz linux-e1e7ecafe6482464ccc510afb38e1b9b306ce5dc.zip |
bcachefs: Improve error handling in bch2_ioctl_subvolume_destroy()
Pure style fixes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-ioctl.c')
-rw-r--r-- | fs/bcachefs/fs-ioctl.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c index b51053130f28..269af9393824 100644 --- a/fs/bcachefs/fs-ioctl.c +++ b/fs/bcachefs/fs-ioctl.c @@ -451,19 +451,20 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp, return ret; if (path.dentry->d_sb->s_fs_info != c) { - path_put(&path); - return -EXDEV; + ret = -EXDEV; + goto err; } 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); + if (ret) + goto err; + fsnotify_rmdir(dir, path.dentry); + d_delete(path.dentry); +err: + path_put(&path); return ret; } |