Btrfs: fix hang when failing to submit bio of directIO
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 17 Jun 2015 08:59:57 +0000 (16:59 +0800)
committerChris Mason <clm@fb.com>
Thu, 2 Jul 2015 00:17:20 +0000 (17:17 -0700)
commitad9ee2053f3f2babebc09ebc4970daa66c56c7ee
tree07c9c002e3b0af7a496ff93ad7d52773c6361244
parent9c6429d96daec64f6b5b10a1c6b02c7264541ea1
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>
fs/btrfs/inode.c