btrfs: remove redundant error check
authorByongho Lee <bhlee.kernel@gmail.com>
Wed, 27 Jan 2016 10:11:53 +0000 (19:11 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 18 Feb 2016 10:35:27 +0000 (11:35 +0100)
While running btrfs_mksubvol(), d_really_is_positive() is called twice.
First in btrfs_mksubvol() and second inside btrfs_may_create().  So I
remove the first one.

Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 952172ca7e455633c28a79292d18ebbfd68c4d18..e65fdc8550b14687d1cc5b7f07e04d49999b76b0 100644 (file)
@@ -844,10 +844,6 @@ static noinline int btrfs_mksubvol(struct path *parent,
        if (IS_ERR(dentry))
                goto out_unlock;
 
-       error = -EEXIST;
-       if (d_really_is_positive(dentry))
-               goto out_dput;
-
        error = btrfs_may_create(dir, dentry);
        if (error)
                goto out_dput;