aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2015-06-17 04:59:57 -0400
committerChris Mason <clm@fb.com>2015-07-01 20:17:20 -0400
commitad9ee2053f3f2babebc09ebc4970daa66c56c7ee (patch)
tree07c9c002e3b0af7a496ff93ad7d52773c6361244 /fs
parent9c6429d96daec64f6b5b10a1c6b02c7264541ea1 (diff)
Btrfs: fix hang when failing to submit bio of directIO
The hang is uncoverd by generic/019. btrfs_endio_direct_write() skips the "finish_ordered_fn" part when it hits an error, thus those added ordered extents will never get processed, which block processes that waiting for them via btrfs_start_ordered_extent(). This fixes the above, and meanwhile finish_ordered_fn will do the space accounting work. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Tested-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 53afda0ef4e3..0b9fb81ccf8a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7872,8 +7872,6 @@ static void btrfs_endio_direct_write(struct bio *bio, int err)
7872 struct bio *dio_bio; 7872 struct bio *dio_bio;
7873 int ret; 7873 int ret;
7874 7874
7875 if (err)
7876 goto out_done;
7877again: 7875again:
7878 ret = btrfs_dec_test_first_ordered_pending(inode, &ordered, 7876 ret = btrfs_dec_test_first_ordered_pending(inode, &ordered,
7879 &ordered_offset, 7877 &ordered_offset,
@@ -7896,7 +7894,6 @@ out_test:
7896 ordered = NULL; 7894 ordered = NULL;
7897 goto again; 7895 goto again;
7898 } 7896 }
7899out_done:
7900 dio_bio = dip->dio_bio; 7897 dio_bio = dip->dio_bio;
7901 7898
7902 kfree(dip); 7899 kfree(dip);