From: Jun'ichi Nomura Date: Mon, 27 Mar 2006 09:17:51 +0000 (-0800) Subject: [PATCH] dm flush queue EINTR X-Git-Tag: v3.12-rc1~37130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ecac7fd74f2e5fb06a7719ecba55fb5778a9a47;p=kernel%2Fkernel-generic.git [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: Jun'ichi Nomura Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm.c b/drivers/md/dm.c index a64798e..48be69f 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1107,6 +1107,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs) { struct dm_table *map = NULL; DECLARE_WAITQUEUE(wait, current); + struct bio *def; int r = -EINVAL; down(&md->suspend_lock); @@ -1166,9 +1167,11 @@ int dm_suspend(struct mapped_device *md, int do_lockfs) /* were we interrupted ? */ r = -EINTR; 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); unlock_fs(md); - clear_bit(DMF_BLOCK_IO, &md->flags); goto out; } up_write(&md->io_lock);