]> err.no Git - linux-2.6/blobdiff - drivers/md/dm.c
[PATCH] dm flush queue EINTR
[linux-2.6] / drivers / md / dm.c
index a64798ef481e585ef9c56e85ece676f42a2494b8..48be69f3bcfa5f6aec2e77d99c6481e1efd127d6 100644 (file)
@@ -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);