switch btrfs_ioctl_clone() to fget_light()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 27 Aug 2012 07:18:55 +0000 (03:18 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Sep 2012 01:10:09 +0000 (21:10 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/ioctl.c

index 3c88abb0e2654e495950a9c9e76583c5b46eba4d..3494f2f44167c40bd2b4356219ef86f62418b75c 100644 (file)
@@ -2350,7 +2350,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
        struct btrfs_key key;
        u32 nritems;
        int slot;
-       int ret;
+       int ret, fput_needed;
        u64 len = olen;
        u64 bs = root->fs_info->sb->s_blocksize;
        u64 hint_byte;
@@ -2376,7 +2376,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
        if (ret)
                return ret;
 
-       src_file = fget(srcfd);
+       src_file = fget_light(srcfd, &fput_needed);
        if (!src_file) {
                ret = -EBADF;
                goto out_drop_write;
@@ -2724,7 +2724,7 @@ out_unlock:
        vfree(buf);
        btrfs_free_path(path);
 out_fput:
-       fput(src_file);
+       fput_light(src_file, fput_needed);
 out_drop_write:
        mnt_drop_write_file(file);
        return ret;