linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Fix BUG_ON when pi errors occur
@ 2014-08-13 11:49 Sagi Grimberg
  2014-08-15 18:47 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2014-08-13 11:49 UTC (permalink / raw)
  To: axboe, martin.petersen; +Cc: kmo, linux-fsdevel, linux-kernel

When getting a pi error we get to bio_integrity_end_io with
bi_remaining already decremented to 0 where we will eventually
need to call bio_endio with restored original bio completion handler.
Calling bio_endio invokes a BUG_ON(). We should call bio_endio_nodec
instead, like what is done in bio_integrity_verify_fn.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 block/bio-integrity.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 9e24106..90d40f9 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -526,7 +526,7 @@ void bio_integrity_endio(struct bio *bio, int error)
 	 */
 	if (error) {
 		bio->bi_end_io = bip->bip_end_io;
-		bio_endio(bio, error);
+		bio_endio_nodec(bio, error);
 
 		return;
 	}
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: Fix BUG_ON when pi errors occur
  2014-08-13 11:49 [PATCH] block: Fix BUG_ON when pi errors occur Sagi Grimberg
@ 2014-08-15 18:47 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-08-15 18:47 UTC (permalink / raw)
  To: Sagi Grimberg, martin.petersen; +Cc: kmo, linux-fsdevel, linux-kernel

On 08/13/2014 05:49 AM, Sagi Grimberg wrote:
> When getting a pi error we get to bio_integrity_end_io with
> bi_remaining already decremented to 0 where we will eventually
> need to call bio_endio with restored original bio completion handler.
> Calling bio_endio invokes a BUG_ON(). We should call bio_endio_nodec
> instead, like what is done in bio_integrity_verify_fn.

Applied, thanks.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-15 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13 11:49 [PATCH] block: Fix BUG_ON when pi errors occur Sagi Grimberg
2014-08-15 18:47 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).