[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [RFC, PATCH] remove signal handling from dm-io.c, sync_io()



I like this solution.  It makes a lot of sense in every regard.

On Sun, Jun 13, 2004 at 08:23:50AM -0500, Kevin Corry wrote:
> 
> In my opinion, we should simply prevent the case of deleting a suspended 
> device, with the following patch.
> 
> --- diff/drivers/md/dm-ioctl.c	2004-06-13 08:14:46.000000000 -0500
> +++ source/drivers/md/dm-ioctl.c	2004-06-13 08:14:43.000000000 -0500
> @@ -632,6 +632,12 @@
>  		return -ENXIO;
>  	}
>  
> +	if (dm_suspended(md)) {
> +		DMWARN("cannot remove suspended device.");
> +		up_write(&_hash_lock);
> +		return -EINVAL;
> +	}
> +
>  	__hash_remove(hc);
>  	up_write(&_hash_lock);
>  	param->data_size = 0;
> 
> This means you can ensure you'll always have a reference to the device to 
> unsuspend it and make sure all the pending I/Os will complete. If we want to 
> reject all pending I/O, there's no need for a new ioctl. You can simply load 
> an error mapping for the device before it's resumed.
> 
> If we take this approach, we should be able to remove the signal handling from 
> sync_io(), and simply use a wait_event() for that loop.
> 
> -- 
> Kevin Corry
> kevcorry us ibm com
> http://evms.sourceforge.net

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]