From 2daba2224dbd2791b593e73b6200c59731b38da6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 17 Apr 2004 03:24:04 -0700 Subject: [PATCH] [PATCH] dm: Handle interrupts within suspend. From: Kevin Corry Handle interrupts within suspend. --- drivers/md/dm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 49878d917103d..b4405ddf9d0c6 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -925,7 +925,7 @@ int dm_suspend(struct mapped_device *md) while (1) { set_current_state(TASK_INTERRUPTIBLE); - if (!atomic_read(&md->pending)) + if (!atomic_read(&md->pending) || signal_pending(current)) break; io_schedule(); @@ -934,6 +934,14 @@ int dm_suspend(struct mapped_device *md) down_write(&md->lock); 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); map = dm_get_table(md); -- 2.53.0