mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-16 22:39:48 +00:00
Btrfs: use insert_inode_locked4 for inode creation
commit b0d5d10f41 upstream.
Btrfs was inserting inodes into the hash table before we had fully
set the inode up on disk. This leaves us open to rare races that allow
two different inodes in memory for the same [root, inode] pair.
This patch fixes things by using insert_inode_locked4 to insert an I_NEW
inode and unlock_new_inode when we're ready for the rest of the kernel
to use the inode.
It also makes sure to init the operations pointers on the inode before
going into the error handling paths.
Signed-off-by: Chris Mason <clm@fb.com>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
f2d649af13
commit
46854f654f
1 changed files with 109 additions and 67 deletions
176
fs/btrfs/inode.c
176
fs/btrfs/inode.c
Loading…
Add table
Add a link
Reference in a new issue