[dm-devel] [PATCH] Flush deferred queue when dm_suspend() is interrupted
Jun'ichi Nomura
j-nomura at ce.jp.nec.com
Thu Mar 9 23:48:29 UTC 2006
Hello,
I found in a code review that dm_suspend() doesn't flush
deferred queue when it's interrupted and failed to suspend.
Attached patch theoretically fixes this problem.
But I don't have a testcase to pick this point
and would like to hear comment from others whether
there is something to prevent this.
Also, modifying DMF_BLOCK_IO outside of io_lock may
cause a race like this:
CPU0 (dm_suspend) CPU1 (dm_request)
-------------------------------------------------
set_bit(DMF_BLOCK_IO)
...
up_write(io_lock)
down_read(io_lock)
test_bit(DMF_BLOCK_IO)
up_read(io_lock)
queue_io(deferred)
down_write(io_lock)
test_bit(DMF_BLOCK_IO)
up_write(io_lock)
clear_bit(DMF_BLOCK_IO)
The deferred I/O never be flushed until dm_resume().
For the failed dm_suspend() case, there is another problem
that presuspend is not reverted.
It may require a new method like suspend_cancel() for
any target which implements presuspend().
I would appreicate a comment for this as well.
Thanks,
--
Jun'ichi Nomura, NEC Solutions (America), Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dm-flush-queue-eintr.patch
Type: text/x-patch
Size: 727 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20060309/a38d3007/attachment.bin>
More information about the dm-devel
mailing list