]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: only clear the need lookup flag after the dentry is setup
authorJosef Bacik <josef@redhat.com>
Sun, 18 Sep 2011 14:34:03 +0000 (10:34 -0400)
committerChris Mason <chris.mason@oracle.com>
Sun, 18 Sep 2011 14:34:03 +0000 (10:34 -0400)
commite15b56ca46b26b4a79f47fe4a2a94a3a0cdc93c0
tree22a508ec3e8735c2e42cbde62f62967d5c25e3e9
parent79120b8ef363d40337998e17def9c9d1d5092cf6
Btrfs: only clear the need lookup flag after the dentry is setup

We can race with readdir and the RCU path walking stuff.  This is because we
clear the need lookup flag before actually instantiating the inode.  This will
lead the RCU path walk stuff to find a dentry it thinks is valid without a
d_inode attached.  So instead unhash the dentry when we first start the lookup,
and then clear the flag after we've instantiated the dentry so we're garunteed
to either try the slow lookup, or have the d_inode set properly.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c