mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
Btrfs: fix deadlock in run_delalloc_nocow
commit e89166990f upstream.
@cur_offset is not set back to what it should be (@cow_start) if
btrfs_next_leaf() returns something wrong, and the range [cow_start,
cur_offset) remains locked forever.
cc: <stable@vger.kernel.org>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f6318abd3a
commit
c766cb4877
@@ -1330,8 +1330,11 @@ next_slot:
|
||||
leaf = path->nodes[0];
|
||||
if (path->slots[0] >= btrfs_header_nritems(leaf)) {
|
||||
ret = btrfs_next_leaf(root, path);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
if (cow_start != (u64)-1)
|
||||
cur_offset = cow_start;
|
||||
goto error;
|
||||
}
|
||||
if (ret > 0)
|
||||
break;
|
||||
leaf = path->nodes[0];
|
||||
|
||||
Reference in New Issue
Block a user