Commit 53b67ae8 authored by Mike Snitzer's avatar Mike Snitzer Committed by Greg Kroah-Hartman

dm thin: fix dangling bio in process_deferred_bios error path

commit fe76cd88 upstream.

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_bios list before all the remaining @bios.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Acked-by: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b4e472ed
...@@ -1446,9 +1446,9 @@ static void process_deferred_bios(struct pool *pool) ...@@ -1446,9 +1446,9 @@ static void process_deferred_bios(struct pool *pool)
*/ */
if (ensure_next_mapping(pool)) { if (ensure_next_mapping(pool)) {
spin_lock_irqsave(&pool->lock, flags); spin_lock_irqsave(&pool->lock, flags);
bio_list_add(&pool->deferred_bios, bio);
bio_list_merge(&pool->deferred_bios, &bios); bio_list_merge(&pool->deferred_bios, &bios);
spin_unlock_irqrestore(&pool->lock, flags); spin_unlock_irqrestore(&pool->lock, flags);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment