]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: hold i_mutex when calling btrfs_log_dentry_safe
authorJosef Bacik <josef@redhat.com>
Fri, 19 Nov 2010 20:36:10 +0000 (20:36 +0000)
committerChris Mason <chris.mason@oracle.com>
Mon, 22 Nov 2010 03:26:09 +0000 (22:26 -0500)
commitc4a9a9b00405477331b2f3ad8133eae1c2844642
tree62729f2b65c9565fadb551bd8d343d6c57d7cb85
parent5ad1dd625b916a4db28d44d8ae6312197b87d2a4
Btrfs: hold i_mutex when calling btrfs_log_dentry_safe

Since we walk up the path logging all of the parts of the inode's path, we need
to hold i_mutex to make sure that the inode is not renamed while we're logging
everything.  btrfs_log_dentry_safe does dget_parent and all of that jazz, but we
may get unexpected results if the rename changes the inode's location while
we're higher up the path logging those dentries, so do this for safety reasons.
Thanks,

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