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>
break;
}
+ mnt_drop_write(file->f_path.mnt);
return 0;
}
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;
btrfs_free_path(path);
out_fput:
fput(src_file);
+out_drop_write:
+ mnt_drop_write(file->f_path.mnt);
return ret;
}