Skip to content
Commit 90d3e592 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: setup inode location during btrfs_init_inode_locked



We have a race during inode init because the BTRFS_I(inode)->location is setup
after the inode hash table lock is dropped.  btrfs_find_actor uses the location
field, so our search might not find an existing inode in the hash table if we
race with the inode init code.

This commit changes things to setup the location field sooner.  Also the find actor now
uses only the location objectid to match inodes.  For inode hashing, we just
need a unique and stable test, it doesn't have to reflect the inode numbers we
show to userland.

Signed-off-by: default avatarChris Mason <clm@fb.com>
CC: stable@vger.kernel.org
parent 514ac8ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment