diff options
author | Jun'ichi Nomura <j-nomura@ce.jp.nec.com> | 2006-03-27 04:17:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:59 -0500 |
commit | 1ecac7fd74f2e5fb06a7719ecba55fb5778a9a47 (patch) | |
tree | 04cd89c4fc1a8996704d7b0df2e62fa1dc33388d /drivers | |
parent | 138728dc96529f20dfe970c470e51885a60e329f (diff) |
[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 <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index a64798ef481e..48be69f3bcfa 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) | |||
1107 | { | 1107 | { |
1108 | struct dm_table *map = NULL; | 1108 | struct dm_table *map = NULL; |
1109 | DECLARE_WAITQUEUE(wait, current); | 1109 | DECLARE_WAITQUEUE(wait, current); |
1110 | struct bio *def; | ||
1110 | int r = -EINVAL; | 1111 | int r = -EINVAL; |
1111 | 1112 | ||
1112 | down(&md->suspend_lock); | 1113 | down(&md->suspend_lock); |
@@ -1166,9 +1167,11 @@ int dm_suspend(struct mapped_device *md, int do_lockfs) | |||
1166 | /* were we interrupted ? */ | 1167 | /* were we interrupted ? */ |
1167 | r = -EINTR; | 1168 | r = -EINTR; |
1168 | if (atomic_read(&md->pending)) { | 1169 | if (atomic_read(&md->pending)) { |
1170 | clear_bit(DMF_BLOCK_IO, &md->flags); | ||
1171 | def = bio_list_get(&md->deferred); | ||
1172 | __flush_deferred_io(md, def); | ||
1169 | up_write(&md->io_lock); | 1173 | up_write(&md->io_lock); |
1170 | unlock_fs(md); | 1174 | unlock_fs(md); |
1171 | clear_bit(DMF_BLOCK_IO, &md->flags); | ||
1172 | goto out; | 1175 | goto out; |
1173 | } | 1176 | } |
1174 | up_write(&md->io_lock); | 1177 | up_write(&md->io_lock); |