aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2008-02-07 21:10:27 -0500
committerAlasdair G Kergon <agk@redhat.com>2008-02-07 21:10:27 -0500
commit94d6351e147231b2c5a9512d69693ee8ac0c204d (patch)
treea0b5c1935077c1bf40db1945c5f30e8d8a9a47a2 /drivers/md
parent73d410c0137f63c6597e9763c81e5f4d015e9940 (diff)
dm: split dm_suspend io_lock hold into two
Change io_locking to allow processing flush in separate thread. Because we have DMF_BLOCK_IO already set, any possible new ios are queued in dm_requests now. In the case of interrupting previous wait there can be more ios queued (we unlocked io_lock for a while) but this is safe. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 5191954a18b2..11f422ecfda0 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1434,9 +1434,11 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
1434 1434
1435 if (noflush) 1435 if (noflush)
1436 __merge_pushback_list(md); 1436 __merge_pushback_list(md);
1437 up_write(&md->io_lock);
1437 1438
1438 /* were we interrupted ? */ 1439 /* were we interrupted ? */
1439 if (pending) { 1440 if (pending) {
1441 down_write(&md->io_lock);
1440 __flush_deferred_io(md); 1442 __flush_deferred_io(md);
1441 up_write(&md->io_lock); 1443 up_write(&md->io_lock);
1442 1444
@@ -1444,7 +1446,6 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
1444 r = -EINTR; 1446 r = -EINTR;
1445 goto out; /* pushback list is already flushed, so skip flush */ 1447 goto out; /* pushback list is already flushed, so skip flush */
1446 } 1448 }
1447 up_write(&md->io_lock);
1448 1449
1449 dm_table_postsuspend_targets(map); 1450 dm_table_postsuspend_targets(map);
1450 1451