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>
This commit is contained in:
committed by
Alasdair G Kergon
parent
73d410c013
commit
94d6351e14
@@ -1434,9 +1434,11 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
|
|||||||
|
|
||||||
if (noflush)
|
if (noflush)
|
||||||
__merge_pushback_list(md);
|
__merge_pushback_list(md);
|
||||||
|
up_write(&md->io_lock);
|
||||||
|
|
||||||
/* were we interrupted ? */
|
/* were we interrupted ? */
|
||||||
if (pending) {
|
if (pending) {
|
||||||
|
down_write(&md->io_lock);
|
||||||
__flush_deferred_io(md);
|
__flush_deferred_io(md);
|
||||||
up_write(&md->io_lock);
|
up_write(&md->io_lock);
|
||||||
|
|
||||||
@@ -1444,7 +1446,6 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)
|
|||||||
r = -EINTR;
|
r = -EINTR;
|
||||||
goto out; /* pushback list is already flushed, so skip flush */
|
goto out; /* pushback list is already flushed, so skip flush */
|
||||||
}
|
}
|
||||||
up_write(&md->io_lock);
|
|
||||||
|
|
||||||
dm_table_postsuspend_targets(map);
|
dm_table_postsuspend_targets(map);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user