[Devel] [PATCH RH9 2/3] dm: Allow singleton target with devices attached

Kirill Tkhai ktkhai at virtuozzo.com
Tue Sep 21 13:23:07 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.

https://jira.sw.ru/browse/PSBM-127989

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 e6b55f067797..607fe294b895 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -945,11 +945,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