Btrfs: fix deadlock in run_delalloc_nocow
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 25 Jan 2018 18:02:50 +0000 (11:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Feb 2018 14:42:29 +0000 (15:42 +0100)
commitc766cb48771b7604fb5beca646bfa9904d0a2b17
tree1678e676494dc199c4c70b309338493f9b6a7478
parentf6318abd3a5458be821eb417969726622e1e09c4
Btrfs: fix deadlock in run_delalloc_nocow

commit e89166990f11c3f21e1649d760dd35f9e410321c 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>
fs/btrfs/inode.c