Commit 2daba222 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: Handle interrupts within suspend.

From: Kevin Corry <kevcorry@us.ibm.com>

Handle interrupts within suspend.
parent 8ceccffc
...@@ -925,7 +925,7 @@ int dm_suspend(struct mapped_device *md) ...@@ -925,7 +925,7 @@ int dm_suspend(struct mapped_device *md)
while (1) { while (1) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (!atomic_read(&md->pending)) if (!atomic_read(&md->pending) || signal_pending(current))
break; break;
io_schedule(); io_schedule();
...@@ -934,6 +934,14 @@ int dm_suspend(struct mapped_device *md) ...@@ -934,6 +934,14 @@ int dm_suspend(struct mapped_device *md)
down_write(&md->lock); down_write(&md->lock);
remove_wait_queue(&md->wait, &wait); remove_wait_queue(&md->wait, &wait);
/* were we interrupted ? */
if (atomic_read(&md->pending)) {
clear_bit(DMF_BLOCK_IO, &md->flags);
up_write(&md->lock);
return -EINTR;
}
set_bit(DMF_SUSPENDED, &md->flags); set_bit(DMF_SUSPENDED, &md->flags);
map = dm_get_table(md); map = dm_get_table(md);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment