From: Mike Snitzer Date: Fri, 28 Mar 2014 06:15:02 +0000 (-0400) Subject: dm thin: fix dangling bio in process_thin_deferred_bios() error path X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=e05a96637d70b2ff47d2c49031d2e22e37ecde8a;p=linux-dmdedup.git dm thin: fix dangling bio in process_thin_deferred_bios() error path If unable to ensure_next_mapping() we must add the current bio, which was removed from the @bios list via bio_list_pop, back to the deferred_list before all the remaining @bios. Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 002b15600fe..05ab9bf6b4f 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1685,6 +1685,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) */ if (ensure_next_mapping(pool)) { spin_lock_irqsave(&tc->lock, flags); + bio_list_add(&tc->deferred_bio_list, bio); bio_list_merge(&tc->deferred_bio_list, &bios); spin_unlock_irqrestore(&tc->lock, flags); break;