Btrfs: move d_instantiate outside the transaction during mksubvol
Dave Sterba triggered a lockdep complaint about lock ordering between the sb_internal lock and the cleaner semaphore. btrfs_lookup_dentry() checks for orphans if we're looking up the inode for a subvolume, and subvolume creation is triggering the lookup with a transaction running. This commit moves the d_instantiate after the transaction closes. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
eb6b88d92c
commit
1a65e24b0b
|
@ -515,7 +515,6 @@ static noinline int create_subvol(struct btrfs_root *root,
|
||||||
|
|
||||||
BUG_ON(ret);
|
BUG_ON(ret);
|
||||||
|
|
||||||
d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
|
|
||||||
fail:
|
fail:
|
||||||
if (async_transid) {
|
if (async_transid) {
|
||||||
*async_transid = trans->transid;
|
*async_transid = trans->transid;
|
||||||
|
@ -525,6 +524,10 @@ fail:
|
||||||
}
|
}
|
||||||
if (err && !ret)
|
if (err && !ret)
|
||||||
ret = err;
|
ret = err;
|
||||||
|
|
||||||
|
if (!ret)
|
||||||
|
d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue