[Devel] [PATCH RHEL COMMIT] dm: Allow singleton target with devices attached

Konstantin Khorenko khorenko at virtuozzo.com
Wed Sep 22 14:39:55 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit b0f07e3209227d86c3608ba289c7031022d3f193
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Wed Sep 22 14:39:55 2021 +0300

    dm: Allow singleton target with devices attached
    
    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