Re: [PATCH] scsi-misc-2.5 user per-device spare command

Christoph Hellwig
2003-04-25T10:00:21Z

On Thu, Apr 24, 2003 at 10:03:17AM -0700, Patrick Mansfield wrote:
> Patch against scsi-misc-2.5
>
> Use a per-device spare command rather than a per-host spare.

Why? This means we'll have a much bigger number of spare commands
around.

> + /*
> + * Use any spare command first.
> + */
> + cmd = sdev->spare_cmd;
> + if (cmd != NULL)
> + sdev->spare_cmd = NULL;
> + else
> + cmd = kmem_cache_alloc(sdev->host->cmd_pool->slab,
> + gfp_mask | sdev->host->cmd_pool->gfp_mask);

This logical is flawed. We don't need a spare command if we always use
it first. In addition the sdev->spare_cmd access is racy.