Re: PATCH:ide_do_reset() fix for 2.5.66

From: Jens Axboe (axboe@suse.de)
Date: Thu Apr 03 2003 - 02:16:20 EST


On Thu, Apr 03 2003, rain.wang wrote:
> Hi Alan,
> I found just changing ide_do_reset() to wait till completion can
> handle the handler race. can this be enough?

This is buggy for a number of reasons. Firstly, how do you make sure
that someone else doesn't race with your hwif_data manipulation? This
looks very suspect. By far the worst problem is that you are assuming
that ide_do_reset() can sleep, when in fact it cannot (just follow the
various paths into ide_do_request()). You even grab the ide_lock _and_
disable interrupts yourself prior calling wait_for_completion(), this is
incredibly broken.

-- 
Jens Axboe

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



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:19 EST