Re: [RFC] Hard disk protection revisited

From: Jens Axboe
Date: Fri Oct 07 2005 - 05:02:10 EST


On Fri, Oct 07 2005, Jon Escombe wrote:
> I would like to submit the latest disk protection (a.k.a. parking and
> freezing) code from the hdaps-devel side for comment, along with a brief
> overview of what's in the patch -
>
> During initialisation, disk drivers with 'protect' helper functions
> (currently ide and libata) fill in two new function pointers in the
> queue structure. A sysfs 'protect' queue attribute is then created in
> the block layer for devices who's lower level drivers have registered
> these helpers.
>
> When a value (in seconds) is written to the protect attribute, the block
> layer code calls the driver 'protect' helper function. This helper
> parks/suspends the disk, and then stops the queue. Control then returns
> to the block layer which re-uses the plugging timer to set an automatic
> timeout to restart the queue. When 0 is written to the protect
> attribute, or the timer expires, the queue is restarted using the
> 'unprotect' helper function, and the plugging timer is restored.
>
> This interface is intended to be used by a daemon process, that monitors
> the hdaps driver output for excessive changes in acceleration, and keeps
> the device parked and the queue stopped until the values become normal.
>
> Patch applies to 2.6.14-rc3 (also 2.6.13.x), and requires libata_passthru..

I have to nack this one for now, I still want the generic command types
patch to go in first. We have far too many queue hooks already, adding
two more for a relatively obscure use such as this one is not a good
idea.

My suggestion is to maintain this patch out of tree for now, it will be
a few kernel release iterations before the command type patch is in.

--
Jens Axboe

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