lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [block:for-3.14/core] kernel BUG at fs/bio.c:1748
Date
On Tue, 2014-01-07 at 12:15 -0800, Muthu Kumar wrote:
> Thanks Fengguang. Final patch with added comment. BTW, fengguang
> mentioned that git-am has trouble with the inline patch and "quilt
> import" worked fine for him...
>
> ------------
> In btrfs_end_bio(), we increment bi_remaining if is_orig_bio. If not,
> we restore the orig_bio but failed to increment bi_remaining for
> orig_bio, which triggers a BUG_ON later when bio_endio is called. Fix
> is to increment bi_remaining when we restore the orig bio as well.
>
> Reported-and-Tested-by: Fengguang wu <fengguang.wu@intel.com>
> CC: Kent Overstreet <kmo@daterainc.com>
> CC: Jens Axboe <axboe@kernel.dk>
> CC: Chris Mason <clm@fb.com>
> Signed-off-by: Muthukumar Ratty <muthur@gmail.com>
>

Reviewed-by: Chris Mason <clm@fb.com>

Jens, please pull this one in.

> -----------
> fs/btrfs/volumes.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 37972d5..34aba2b 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -5297,9 +5297,13 @@ static void btrfs_end_bio(struct bio *bio, int err)
> if (!is_orig_bio) {
> bio_put(bio);
> bio = bbio->orig_bio;
> - } else {
> - atomic_inc(&bio->bi_remaining);
> }
> + /*
> + * We have original bio now. So increment bi_remaining to
> + * account for it in endio
> + */
> + atomic_inc(&bio->bi_remaining);
> +
> bio->bi_private = bbio->private;
> bio->bi_end_io = bbio->end_io;
> btrfs_io_bio(bio)->mirror_num = bbio->mirror_num;
>
> -------------------------------------




\
 
 \ /
  Last update: 2014-01-08 22:41    [W:0.141 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site