[Devel] [PATCH RHEL8 COMMIT] ploop: Add argument into push_backup_stop

Konstantin Khorenko khorenko at virtuozzo.com
Fri Oct 25 16:52:34 MSK 2019


The commit is pushed to "branch-rh8-4.18.0-80.1.2.vz8.2.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-80.1.2.vz8.2.3
------>
commit 468de9fe29116fd4a9c954b0118806787559a7ad
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Oct 25 16:52:32 2019 +0300

    ploop: Add argument into push_backup_stop
    
    Similar to old ploop, add an argument. Currently,
    it's noop since we do not analyze it.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-cmd.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 1836ac1a3b21..0aa643d9c9fa 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -1392,7 +1392,7 @@ static int ploop_push_backup_start(struct ploop *ploop, char *uuid,
 }
 
 static int ploop_push_backup_stop(struct ploop *ploop, char *uuid,
-				  char *result, unsigned int maxlen)
+		   int uretval, char *result, unsigned int maxlen)
 {
 	struct ploop_cmd cmd = { {0} };
 	unsigned int sz = 0;
@@ -1567,8 +1567,8 @@ int ploop_message(struct dm_target *ti, unsigned int argc, char **argv,
 		  char *result, unsigned int maxlen)
 {
 	struct ploop *ploop = ti->private;
+	int ival, ret = -EPERM;
 	bool forward = true;
-	int ret = -EPERM;
 	u64 val, val2;
 
 	if (!capable(CAP_SYS_ADMIN))
@@ -1627,9 +1627,10 @@ int ploop_message(struct dm_target *ti, unsigned int argc, char **argv,
 			goto unlock;
 		ret = ploop_push_backup_start(ploop, argv[1], (void *)val);
 	} else if (!strcmp(argv[0], "push_backup_stop")) {
-		if (argc != 2)
+		if (argc != 3 || kstrtos32(argv[2], 10, &ival) < 0)
 			goto unlock;
-		ret = ploop_push_backup_stop(ploop, argv[1], result, maxlen);
+		ret = ploop_push_backup_stop(ploop, argv[1], ival,
+					     result, maxlen);
 	} else if (!strcmp(argv[0], "push_backup_get_uuid")) {
 		if (argc != 1)
 			goto unlock;



More information about the Devel mailing list