mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
ee20a98314
commit
f3b15ccdbb
|
@ -3746,8 +3746,9 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
|
||||||
}
|
}
|
||||||
|
|
||||||
log_extents:
|
log_extents:
|
||||||
|
btrfs_release_path(path);
|
||||||
|
btrfs_release_path(dst_path);
|
||||||
if (fast_search) {
|
if (fast_search) {
|
||||||
btrfs_release_path(dst_path);
|
|
||||||
ret = btrfs_log_changed_extents(trans, root, inode, dst_path);
|
ret = btrfs_log_changed_extents(trans, root, inode, dst_path);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
err = ret;
|
err = ret;
|
||||||
|
@ -3764,8 +3765,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
|
if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
|
||||||
btrfs_release_path(path);
|
|
||||||
btrfs_release_path(dst_path);
|
|
||||||
ret = log_directory_changes(trans, root, inode, path, dst_path);
|
ret = log_directory_changes(trans, root, inode, path, dst_path);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
err = ret;
|
err = ret;
|
||||||
|
|
Loading…
Reference in New Issue