[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180221124537.653207010@linuxfoundation.org>
Date: Wed, 21 Feb 2018 13:49:24 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Liu Bo <bo.li.liu@...cle.com>,
Josef Bacik <jbacik@...com>, David Sterba <dsterba@...e.com>
Subject: [PATCH 4.15 135/163] Btrfs: fix deadlock in run_delalloc_nocow
4.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <bo.li.liu@...cle.com>
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@...r.kernel.org>
Signed-off-by: Liu Bo <bo.li.liu@...cle.com>
Reviewed-by: Josef Bacik <jbacik@...com>
Signed-off-by: David Sterba <dsterba@...e.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/btrfs/inode.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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];
Powered by blists - more mailing lists