[Devel] [PATCH RHEL8 COMMIT] ploop: Add ignore_signature_disk_in_use parameter

Konstantin Khorenko khorenko at virtuozzo.com
Tue May 4 16:59:28 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 59a91c73a6516218d56b95cabb179aa7da623415
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue May 4 16:59:28 2021 +0300

    ploop: Add ignore_signature_disk_in_use parameter
    
    Normally, userspace sets this parameter. But during development
    it's usable to mount ploop directly (say, via bash script).
    Introduce this parameter to ignore that signature is not set.
    
    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-bat.c    | 2 +-
 drivers/md/dm-ploop-target.c | 5 +++++
 drivers/md/dm-ploop.h        | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index ee7150f5ae80..8226411c2dc8 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -255,7 +255,7 @@ int ploop_read_metadata(struct dm_target *ti, struct ploop *ploop)
 
 	ret = -ENOLCK;
 	if (m_hdr->m_DiskInUse != cpu_to_le32(SIGNATURE_DISK_IN_USE) &&
-	    !ploop_is_ro(ploop))
+	    !ploop_is_ro(ploop) && !ignore_signature_disk_in_use)
 		goto out;
 
 	ret = -EINVAL;
diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 5581e2722e0b..37e581f2997f 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -13,6 +13,11 @@
 
 #define DM_MSG_PREFIX "ploop"
 
+bool ignore_signature_disk_in_use = false; /* For development purposes */
+module_param(ignore_signature_disk_in_use, bool, 0444);
+MODULE_PARM_DESC(ignore_signature_disk_in_use,
+                "Does not check for SIGNATURE_DISK_IN_USE");
+
 struct kmem_cache *piocb_cache;
 struct kmem_cache *cow_cache;
 
diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h
index 1741a2075fb2..54baa1aa0229 100644
--- a/drivers/md/dm-ploop.h
+++ b/drivers/md/dm-ploop.h
@@ -274,6 +274,7 @@ struct ploop_cow {
 	void *data; /* Second argument of end_fn */
 };
 
+extern bool ignore_signature_disk_in_use;
 extern struct kmem_cache *piocb_cache;
 extern struct kmem_cache *cow_cache;
 


More information about the Devel mailing list