[Devel] [PATCH RHEL8 COMMIT] ploop: Move check in ploop_ctr()

Konstantin Khorenko khorenko at virtuozzo.com
Tue May 4 16:59:26 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.25
------>
commit 9dbb5b4ea8b7dee4f71f76e14032a7db587ceace
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue May 4 16:59:26 2021 +0300

    ploop: Move check in ploop_ctr()
    
    To_merge: 3e892fb36c57 ("dm: Interpreter of ploop1 format (ploop driver)")
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    ploop: Preparation to kill-loop from dm-ploop (series 1)
    
    Currently, ploop requires underlining loop for top delta. This is overkill,
    since we may submit bios directly to fs, without using it.
    
    Initially there was a possibility, we may use device-mapper format snapshots
    instead of ploop-based. But we don't do that, so we have to use loop for top
    delta and directly submit bios to the rest of deltas. So, these two ways to do
    the same actions are wrong.
    
    This is preparations#1 for further series.
    Let's this goes to testing earlier.
    
    Kirill Tkhai (7):
          ploop: Kill "add_delta" interface
          ploop: Refactor ploop_add_delta()
          ploop: Move check in ploop_ctr()
          ploop: Call add_delta directly
          ploop: Move add_delta iterating code to separate function
          ploop: Allocate deltas in only place
          ploop: Add ignore_signature_disk_in_use parameter
    
    https://jira.sw.ru/browse/PSBM-123654
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-target.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 9b94f5f21c6c..97683231b0a5 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -164,6 +164,11 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		ti->error = "could not parse cluster_log";
 		goto err;
 	}
+	ret = dm_set_target_max_io_len(ti, 1 << ploop->cluster_log);
+	if (ret) {
+		ti->error = "could not set max_io_len";
+		goto err;
+	}
 
 	/*
 	 * We do not add FMODE_EXCL, because further open_table_device()
@@ -182,12 +187,6 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto err;
 	}
 
-	ret = dm_set_target_max_io_len(ti, 1 << ploop->cluster_log);
-	if (ret) {
-		ti->error = "could not set max_io_len";
-		goto err;
-	}
-
 	ret = -ENOMEM;
 
 	ploop->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);


More information about the Devel mailing list