Re: [PATCH] New QStor SATA/RAID Driver for 2.6.9-rc2

James Bottomley
2004-09-14T18:38:06Z

On Tue, 2004-09-14 at 13:00, Jeff Garzik wrote:
> 9) use of do_sleep paradigm is dubious: you should instead try to keep
> your locked code regions as small as possible. in general, this code
> has far too many unlock-doit-lock sections.
>
> Experience has shown that too much unlock-doit-lock leads to bugs and
> increases the pain when analyzing your locking.
>
> In particular, releasing the lock and sleeping would be very wrong in
> the ->queuecommand and error handling paths (alas... I would love to
> sleep in the fine-grained eh hooks)

Actually, its only wrong in queuecommand because that can be called in
softirq context.

Sleeping in the eh paths is fine (as long as you drop the locks that the
EH thread has uselessly taken for you). Indeed it's often required
since the return is supposed to tell the eh thread whether the action
was successful or not.

James