Btrfs: use right root when checking for hash collision
authorJosef Bacik <jbacik@fusionio.com>
Wed, 9 Oct 2013 16:24:04 +0000 (12:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Oct 2013 14:45:44 +0000 (07:45 -0700)
commita849b2f4200ab490d7a6d80e7632d28dc80c8f6f
treee363ec871104812b9483f00c6a2ddecdbd25c5aa
parent8c279694727d2ec6de4cc9dc96b1d0cfac0f5295
Btrfs: use right root when checking for hash collision

commit 4871c1588f92c6c13f4713a7009f25f217055807 upstream.

btrfs_rename was using the root of the old dir instead of the root of the new
dir when checking for a hash collision, so if you tried to move a file into a
subvol it would freak out because it would see the file you are trying to move
in its current root.  This fixes the bug where this would fail

btrfs subvol create test1
btrfs subvol create test2
mv test1 test2.

Thanks to Chris Murphy for catching this,

Reported-by: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c