]> Git Repo - linux.git/commitdiff
Btrfs: fix hang when failing to submit bio of directIO
authorLiu Bo <[email protected]>
Wed, 17 Jun 2015 08:59:57 +0000 (16:59 +0800)
committerChris Mason <[email protected]>
Thu, 2 Jul 2015 00:17:20 +0000 (17:17 -0700)
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 <[email protected]>
Reviewed-by: Filipe Manana <[email protected]>
Tested-by: Filipe Manana <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
fs/btrfs/inode.c

index 53afda0ef4e348399da6767591f52e50c1f17410..0b9fb81ccf8a6b9e9e56b017786df01aa480adb2 100644 (file)
@@ -7872,8 +7872,6 @@ static void btrfs_endio_direct_write(struct bio *bio, int err)
        struct bio *dio_bio;
        int ret;
 
-       if (err)
-               goto out_done;
 again:
        ret = btrfs_dec_test_first_ordered_pending(inode, &ordered,
                                                   &ordered_offset,
@@ -7896,7 +7894,6 @@ out_test:
                ordered = NULL;
                goto again;
        }
-out_done:
        dio_bio = dip->dio_bio;
 
        kfree(dip);
This page took 0.071566 seconds and 4 git commands to generate.