Commit f3b15ccdbb9a79781578249a63318805e55a6c34

Authored by Josef Bacik
Committed by Chris Mason
1 parent ee20a98314

Btrfs: release both paths before logging dir/changed extents

The ceph guys tripped over this bug where we were still holding onto the
original path that we used to copy the inode with when logging.  This is based
on Chris's fix which was reported to fix the problem.  We need to drop the paths
in two cases anyway so just move the drop up so that we don't have duplicate
code.  Thanks,

Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -3746,8 +3746,9 @@
3746 3746 }
3747 3747  
3748 3748 log_extents:
  3749 + btrfs_release_path(path);
  3750 + btrfs_release_path(dst_path);
3749 3751 if (fast_search) {
3750   - btrfs_release_path(dst_path);
3751 3752 ret = btrfs_log_changed_extents(trans, root, inode, dst_path);
3752 3753 if (ret) {
3753 3754 err = ret;
... ... @@ -3764,8 +3765,6 @@
3764 3765 }
3765 3766  
3766 3767 if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
3767   - btrfs_release_path(path);
3768   - btrfs_release_path(dst_path);
3769 3768 ret = log_directory_changes(trans, root, inode, path, dst_path);
3770 3769 if (ret) {
3771 3770 err = ret;