Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754051AbaAGUPt (ORCPT ); Tue, 7 Jan 2014 15:15:49 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:46285 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752741AbaAGUPk (ORCPT ); Tue, 7 Jan 2014 15:15:40 -0500 MIME-Version: 1.0 In-Reply-To: <20140107055318.GA19016@localhost> References: <20140102053101.GA29352@localhost> <20140106221036.GE9037@kmo> <20140107055318.GA19016@localhost> Date: Tue, 7 Jan 2014 12:15:39 -0800 Message-ID: Subject: Re: [block:for-3.14/core] kernel BUG at fs/bio.c:1748 From: Muthu Kumar To: Fengguang Wu Cc: Kent Overstreet , Chris Mason , Jens Axboe , linux-btrfs , linux-fsdevel , LKML , lkp@linux.intel.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 CC: Kent Overstreet CC: Jens Axboe CC: Chris Mason Signed-off-by: Muthukumar Ratty ----------- 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; ------------------------------------- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/