diff mbox

[1/2] Btrfs: fix hang when failing to submit bio of directIO

Message ID 1434531598-8607-1-git-send-email-bo.li.liu@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Liu Bo June 17, 2015, 8:59 a.m. UTC
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>
---
 fs/btrfs/inode.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Filipe Manana June 30, 2015, 8:20 a.m. UTC | #1
On Wed, Jun 17, 2015 at 9:59 AM, Liu Bo <bo.li.liu@oracle.com> wrote:
> 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>

> ---
>  fs/btrfs/inode.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 8bb0136..7bf150a 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -7855,8 +7855,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,
> @@ -7879,7 +7877,6 @@ out_test:
>                 ordered = NULL;
>                 goto again;
>         }
> -out_done:
>         dio_bio = dip->dio_bio;
>
>         kfree(dip);
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8bb0136..7bf150a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7855,8 +7855,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,
@@ -7879,7 +7877,6 @@  out_test:
 		ordered = NULL;
 		goto again;
 	}
-out_done:
 	dio_bio = dip->dio_bio;
 
 	kfree(dip);