diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-19 10:58:39 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-19 10:58:39 -0500 |
commit | ab67b7c1f780a8a321fe7ee49117775009350fb3 (patch) | |
tree | 35a7ac2e5f641d8f11d472d7f84601d16f4fcddc /fs/btrfs | |
parent | b16281c30c841c6d999ff36c8d903f42a69315f2 (diff) |
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: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ioctl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5d67858ce993..ab429fe0fa0f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -646,6 +646,7 @@ static int btrfs_ioctl_defrag(struct file *file) | |||
646 | break; | 646 | break; |
647 | } | 647 | } |
648 | 648 | ||
649 | mnt_drop_write(file->f_path.mnt); | ||
649 | return 0; | 650 | return 0; |
650 | } | 651 | } |
651 | 652 | ||
@@ -730,8 +731,10 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
730 | return ret; | 731 | return ret; |
731 | 732 | ||
732 | src_file = fget(srcfd); | 733 | src_file = fget(srcfd); |
733 | if (!src_file) | 734 | if (!src_file) { |
734 | return -EBADF; | 735 | ret = -EBADF; |
736 | goto out_drop_write; | ||
737 | } | ||
735 | src = src_file->f_dentry->d_inode; | 738 | src = src_file->f_dentry->d_inode; |
736 | 739 | ||
737 | ret = -EINVAL; | 740 | ret = -EINVAL; |
@@ -982,6 +985,8 @@ out_unlock: | |||
982 | btrfs_free_path(path); | 985 | btrfs_free_path(path); |
983 | out_fput: | 986 | out_fput: |
984 | fput(src_file); | 987 | fput(src_file); |
988 | out_drop_write: | ||
989 | mnt_drop_write(file->f_path.mnt); | ||
985 | return ret; | 990 | return ret; |
986 | } | 991 | } |
987 | 992 | ||