[dm-devel] [PATCH 5/8] [dm-thin] Fix a race condition between discard bios and ordinary bios.

Alasdair G Kergon agk at redhat.com
Tue Jan 22 00:03:21 UTC 2013


On Thu, Dec 13, 2012 at 08:19:13PM +0000, Joe Thornber wrote:
> diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
> index 504f3d6..8e47f44 100644
> --- a/drivers/md/dm-thin.c
> +++ b/drivers/md/dm-thin.c

> @@ -1470,19 +1492,24 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
>  			return DM_MAPIO_SUBMITTED;
>  		}
>  
> +		spin_lock(&tc->lock);
>  		build_virtual_key(tc->td, block, &key);
> -		if (bio_detain(tc->pool, &key, bio, &cell1))
> +		if (dm_bio_detain(tc->pool->prison, &key, bio, &tc->cell1, &cell_result)) {

Use same variable name cell_result down in the depths of the function
itself and all its callers?

Alasdair




More information about the dm-devel mailing list