Re: [block:for-3.14/core] kernel BUG at fs/bio.c:1748

From: Chris Mason
Date: Wed Jan 08 2014 - 16:14:05 EST


On Tue, 2014-01-07 at 12:15 -0800, Muthu Kumar wrote:
+AD4- Thanks Fengguang. Final patch with added comment. BTW, fengguang
+AD4- mentioned that git-am has trouble with the inline patch and +ACI-quilt
+AD4- import+ACI- worked fine for him...
+AD4-
+AD4- ------------
+AD4- In btrfs+AF8-end+AF8-bio(), we increment bi+AF8-remaining if is+AF8-orig+AF8-bio. If not,
+AD4- we restore the orig+AF8-bio but failed to increment bi+AF8-remaining for
+AD4- orig+AF8-bio, which triggers a BUG+AF8-ON later when bio+AF8-endio is called. Fix
+AD4- is to increment bi+AF8-remaining when we restore the orig bio as well.
+AD4-
+AD4- Reported-and-Tested-by: Fengguang wu +ADw-fengguang.wu+AEA-intel.com+AD4-
+AD4- CC: Kent Overstreet +ADw-kmo+AEA-daterainc.com+AD4-
+AD4- CC: Jens Axboe +ADw-axboe+AEA-kernel.dk+AD4-
+AD4- CC: Chris Mason +ADw-clm+AEA-fb.com+AD4-
+AD4- Signed-off-by: Muthukumar Ratty +ADw-muthur+AEA-gmail.com+AD4-
+AD4-

Reviewed-by: Chris Mason +ADw-clm+AEA-fb.com+AD4-

Jens, please pull this one in.

+AD4- -----------
+AD4- fs/btrfs/volumes.c +AHw- 8 +-+-+-+-+-+---
+AD4- 1 files changed, 6 insertions(+-), 2 deletions(-)
+AD4-
+AD4- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
+AD4- index 37972d5..34aba2b 100644
+AD4- --- a/fs/btrfs/volumes.c
+AD4- +-+-+- b/fs/btrfs/volumes.c
+AD4- +AEAAQA- -5297,9 +-5297,13 +AEAAQA- static void btrfs+AF8-end+AF8-bio(struct bio +ACo-bio, int err)
+AD4- if (+ACE-is+AF8-orig+AF8-bio) +AHs-
+AD4- bio+AF8-put(bio)+ADs-
+AD4- bio +AD0- bbio-+AD4-orig+AF8-bio+ADs-
+AD4- - +AH0- else +AHs-
+AD4- - atomic+AF8-inc(+ACY-bio-+AD4-bi+AF8-remaining)+ADs-
+AD4- +AH0-
+AD4- +- /+ACo-
+AD4- +- +ACo- We have original bio now. So increment bi+AF8-remaining to
+AD4- +- +ACo- account for it in endio
+AD4- +- +ACo-/
+AD4- +- atomic+AF8-inc(+ACY-bio-+AD4-bi+AF8-remaining)+ADs-
+AD4- +-
+AD4- bio-+AD4-bi+AF8-private +AD0- bbio-+AD4-private+ADs-
+AD4- bio-+AD4-bi+AF8-end+AF8-io +AD0- bbio-+AD4-end+AF8-io+ADs-
+AD4- btrfs+AF8-io+AF8-bio(bio)-+AD4-mirror+AF8-num +AD0- bbio-+AD4-mirror+AF8-num+ADs-
+AD4-
+AD4- -------------------------------------


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/