From: Yan Zheng Date: Fri, 19 Dec 2008 15:58:39 +0000 (-0500) Subject: Btrfs: Add missing mnt_drop_write in ioctl.c X-Git-Tag: v2.6.29-rc1~27^2~9^2~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ab67b7c1f780a8a321fe7ee49117775009350fb3;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5d67858ce99..ab429fe0fa0 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -646,6 +646,7 @@ static int btrfs_ioctl_defrag(struct file *file) break; } + mnt_drop_write(file->f_path.mnt); return 0; } @@ -730,8 +731,10 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, return ret; src_file = fget(srcfd); - if (!src_file) - return -EBADF; + if (!src_file) { + ret = -EBADF; + goto out_drop_write; + } src = src_file->f_dentry->d_inode; ret = -EINVAL; @@ -982,6 +985,8 @@ out_unlock: btrfs_free_path(path); out_fput: fput(src_file); +out_drop_write: + mnt_drop_write(file->f_path.mnt); return ret; }