aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2015-05-14 15:41:07 -0400
committerChris Mason <clm@fb.com>2015-06-03 07:02:56 -0400
commit0f31871f4411b5c0d42fb4403dec83a21a96100b (patch)
treeed012f7057b95cd5b6dcea79ad99b49b14aad6b4 /fs/btrfs/extent_io.c
parentc152b63efc94d5fd486a39e9df5e61ae77e08e44 (diff)
Btrfs: wake up extent state waiters on unlock through clear_extent_bits
When we clear an extent state's EXTENT_LOCKED bit with clear_extent_bits() through free_io_failure(), we weren't waking up any tasks waiting for the extent's state EXTENT_LOCKED bit, leading to an hang. So make sure clear_extent_bits() ends up waking up any waiters if the bit EXTENT_LOCKED is supplied by its callers. Zygo Blaxell was experiencing such hangs at inode eviction time after file unlinks. Thanks to him for a set of scripts to reproduce the issue. Reported-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index c32d226bfecc..856c2e8ea6ac 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1277,7 +1277,12 @@ int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1277int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 1277int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1278 unsigned bits, gfp_t mask) 1278 unsigned bits, gfp_t mask)
1279{ 1279{
1280 return clear_extent_bit(tree, start, end, bits, 0, 0, NULL, mask); 1280 int wake = 0;
1281
1282 if (bits & EXTENT_LOCKED)
1283 wake = 1;
1284
1285 return clear_extent_bit(tree, start, end, bits, wake, 0, NULL, mask);
1281} 1286}
1282 1287
1283int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, 1288int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end,