]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - fs/btrfs/ioctl.c
Btrfs: move d_instantiate outside the transaction during mksubvol
[~shefty/rdma-dev.git] / fs / btrfs / ioctl.c
index afbf3ac2079d32df58a2b0912f5f03267bae77bf..a31cd931d36efa5bf6be0325d2a64ed39a84684d 100644 (file)
@@ -515,7 +515,6 @@ static noinline int create_subvol(struct btrfs_root *root,
 
        BUG_ON(ret);
 
-       d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
 fail:
        if (async_transid) {
                *async_transid = trans->transid;
@@ -525,6 +524,10 @@ fail:
        }
        if (err && !ret)
                ret = err;
+
+       if (!ret)
+               d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
+
        return ret;
 }