projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3acbcbf
)
Btrfs: fix deadlock in run_delalloc_nocow
author
Liu Bo
<
[email protected]
>
Thu, 25 Jan 2018 18:02:50 +0000
(11:02 -0700)
committer
David Sterba
<
[email protected]
>
Fri, 2 Feb 2018 15:24:19 +0000
(16:24 +0100)
@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: <
[email protected]
>
Signed-off-by: Liu Bo <
[email protected]
>
Reviewed-by: Josef Bacik <
[email protected]
>
Signed-off-by: David Sterba <
[email protected]
>
fs/btrfs/inode.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/inode.c
b/fs/btrfs/inode.c
index c5f31817778bc1fe9dc5027153de3bfcd2cc759a..a68a4acd16e51aac6e3633f7753ee66884b86069 100644
(file)
--- a/
fs/btrfs/inode.c
+++ b/
fs/btrfs/inode.c
@@
-1334,8
+1334,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];