corruption with mtdblock

David Woodhouse dwmw2 at infradead.org
Thu Nov 9 02:58:17 EST 2000


On Wed, 8 Nov 2000, Nicolas Pitre wrote:

> > I think we still need to disable plugging to protect the head of the 
> > list. It's a small race but it's non-zero.
> 
> Please show me.

	CPU 0			CPU 1

    handle_mtdblock_request()
	-> end_request()


	   * Request queue is now empty *

			    __make_request()
    io_request_unlock
			    	-> io_request_lock
				   plug_device_fn()
				   put request on queue
				   io_request_unlock


	   * Request queue is plugged, but !empty *

    io_request_lock
    if (!QUEUE_EMPTY)
	handle_mtdblock_request()  ---- BOOM!


I agree that plugging is useful for us. So rather than disabling it, how
about changing the check in mtdblock_thread() to:

	if (QUEUE_EMPTY || QUEUE_PLUGGED)

-- 
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list