Skip to content

Commit

Permalink
dm: split dm_suspend io_lock hold into two
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
  • Loading branch information
Milan Broz authored and kergon committed Feb 8, 2008
1 parent 73d410c commit 94d6351
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,17 +1434,18 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags)

if (noflush)
__merge_pushback_list(md);
up_write(&md->io_lock);

/* were we interrupted ? */
if (pending) {
down_write(&md->io_lock);
__flush_deferred_io(md);
up_write(&md->io_lock);

unlock_fs(md);
r = -EINTR;
goto out; /* pushback list is already flushed, so skip flush */
}
up_write(&md->io_lock);

dm_table_postsuspend_targets(map);

Expand Down

0 comments on commit 94d6351

Please sign in to comment.