Re: [PATCH 9/12] repost: cciss: add busy_configuring flag

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

 



On Mon, Nov 06 2006, Mike Miller (OS Dev) wrote:
> PATCH 9 of 12
> 
> This patch adds a check for busy_configuring to prevent starting a queue
> on a drive that may be in the midst of updating, configuring, deleting, etc.
> 
> This had a test for if the queue was stopped or plugged but that seemed
> to cause issues.
> Please consider this for inclusion.
> 
> Thanks,
> mikem
> 
> Signed-off-by: Mike Miller <mike.miller@xxxxxx>
> 
> --------------------------------------------------------------------------------
> 
> ---
> 
>  drivers/block/cciss.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff -puN drivers/block/cciss.c~cciss_busy_conf_for_lx2619-rc4 drivers/block/cciss.c
> --- linux-2.6/drivers/block/cciss.c~cciss_busy_conf_for_lx2619-rc4	2006-11-06 13:27:53.000000000 -0600
> +++ linux-2.6-root/drivers/block/cciss.c	2006-11-06 13:27:53.000000000 -0600
> @@ -1190,8 +1190,11 @@ static void cciss_check_queues(ctlr_info
>  		/* make sure the disk has been added and the drive is real
>  		 * because this can be called from the middle of init_one.
>  		 */
> -		if (!(h->drv[curr_queue].queue) || !(h->drv[curr_queue].heads))
> +		if (!(h->drv[curr_queue].queue) ||
> +		    !(h->drv[curr_queue].heads) ||
> +		    h->drv[curr_queue].busy_configuring)
>  			continue;
> +
>  		blk_start_queue(h->gendisk[curr_queue]->queue);

This is racy, because you don't start the queue when you unset
->busy_configuring later on. For this to be safe, you need to call
blk_start_queue() when you set ->busy_configuring to 0.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux