diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-10-09 12:24:04 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-10-10 21:27:45 -0400 |
commit | 4871c1588f92c6c13f4713a7009f25f217055807 (patch) | |
tree | 00cfb64474f911d76db079c5a0f44b84de7e6ac8 /fs | |
parent | 1357272fc7deeebb7b3c5d1a071562edc273cdaf (diff) |
Btrfs: use right root when checking for hash collision
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,
Cc: stable@vger.kernel.org
Reported-by: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8af6c03953ad..3b4ffaf0cd52 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7986,7 +7986,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
7986 | 7986 | ||
7987 | 7987 | ||
7988 | /* check for collisions, even if the name isn't there */ | 7988 | /* check for collisions, even if the name isn't there */ |
7989 | ret = btrfs_check_dir_item_collision(root, new_dir->i_ino, | 7989 | ret = btrfs_check_dir_item_collision(dest, new_dir->i_ino, |
7990 | new_dentry->d_name.name, | 7990 | new_dentry->d_name.name, |
7991 | new_dentry->d_name.len); | 7991 | new_dentry->d_name.len); |
7992 | 7992 | ||