[Devel] [PATCH RH8 09/14] dm: Allow singleton target with devices attached

Kirill Tkhai ktkhai at virtuozzo.com
Mon Sep 6 18:34:56 MSK 2021


To replace ploop target with push backup on reload
we have to make them both !immutable. But after that,
we fail on this check, since it prohibits !immutable
targets, which are connected with real devices.

I don't see real reasons for that. The commit, which
added the check, cares about NVME bio base targets
(22c11858e800 "dm: introduce DM_TYPE_NVME_BIO_BASED").
Both ploop and push_backup drivers will be !bio based
(request-based push backup is under developments).
So, it looks safe to replace this with another check.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-table.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index fdca63e7db9b..b130ccf6e4b2 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -960,11 +960,8 @@ static int dm_table_determine_type(struct dm_table *t)
 		return 0;
 	}
 
-	tgt = dm_table_get_immutable_target(t);
-	if (!tgt) {
-		DMERR("table load rejected: immutable target is required");
-		return -EINVAL;
-	} else if (tgt->max_io_len) {
+	tgt = &t->targets[0];
+	if (tgt->max_io_len) {
 		DMERR("table load rejected: immutable target that splits IO is not supported");
 		return -EINVAL;
 	}




More information about the Devel mailing list