Commit ab67b7c1 authored by Yan Zheng's avatar Yan Zheng Committed by Chris Mason

Btrfs: Add missing mnt_drop_write in ioctl.c

This patch adds the missing mnt_drop_write to match
mnt_want_write in btrfs_ioctl_defrag and btrfs_ioctl_clone
Signed-off-by: default avatarYan Zheng <zheng.yan@oracle.com>
parent b16281c3
...@@ -646,6 +646,7 @@ static int btrfs_ioctl_defrag(struct file *file) ...@@ -646,6 +646,7 @@ static int btrfs_ioctl_defrag(struct file *file)
break; break;
} }
mnt_drop_write(file->f_path.mnt);
return 0; return 0;
} }
...@@ -730,8 +731,10 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, ...@@ -730,8 +731,10 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
return ret; return ret;
src_file = fget(srcfd); src_file = fget(srcfd);
if (!src_file) if (!src_file) {
return -EBADF; ret = -EBADF;
goto out_drop_write;
}
src = src_file->f_dentry->d_inode; src = src_file->f_dentry->d_inode;
ret = -EINVAL; ret = -EINVAL;
...@@ -982,6 +985,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, ...@@ -982,6 +985,8 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
btrfs_free_path(path); btrfs_free_path(path);
out_fput: out_fput:
fput(src_file); fput(src_file);
out_drop_write:
mnt_drop_write(file->f_path.mnt);
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