Commit 1ecac7fd authored by Jun'ichi Nomura's avatar Jun'ichi Nomura Committed by Linus Torvalds

[PATCH] dm flush queue EINTR

If dm_suspend() is cancelled, bios already added to the deferred list need to
be submitted.  Otherwise they remain 'in limbo' until there's a dm_resume().
Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 138728dc
...@@ -1107,6 +1107,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs) ...@@ -1107,6 +1107,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
{ {
struct dm_table *map = NULL; struct dm_table *map = NULL;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
struct bio *def;
int r = -EINVAL; int r = -EINVAL;
down(&md->suspend_lock); down(&md->suspend_lock);
...@@ -1166,9 +1167,11 @@ int dm_suspend(struct mapped_device *md, int do_lockfs) ...@@ -1166,9 +1167,11 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
/* were we interrupted ? */ /* were we interrupted ? */
r = -EINTR; r = -EINTR;
if (atomic_read(&md->pending)) { if (atomic_read(&md->pending)) {
clear_bit(DMF_BLOCK_IO, &md->flags);
def = bio_list_get(&md->deferred);
__flush_deferred_io(md, def);
up_write(&md->io_lock); up_write(&md->io_lock);
unlock_fs(md); unlock_fs(md);
clear_bit(DMF_BLOCK_IO, &md->flags);
goto out; goto out;
} }
up_write(&md->io_lock); up_write(&md->io_lock);
......
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