From 8757b7764f13e336f3c0eb1f634440d4ee4c3a67 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 3 Oct 2006 01:15:36 -0700 Subject: [PATCH] dm table: add target preresume This patch adds a target preresume hook. It is called before the targets are resumed and if it returns an error the resume gets cancelled. The crypt target will use this to indicate that it is unable to process I/O because no encryption key has been supplied. Signed-off-by: Milan Broz Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/md/dm.c') diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 883860c3565..aeb63a3ac33 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1360,7 +1360,9 @@ int dm_resume(struct mapped_device *md) if (!map || !dm_table_get_size(map)) goto out; - dm_table_resume_targets(map); + r = dm_table_resume_targets(map); + if (r) + goto out; down_write(&md->io_lock); clear_bit(DMF_BLOCK_IO, &md->flags); -- cgit v1.2.3