[Devel] [PATCH RHEL COMMIT] push_backup: Take rwsem killable

Konstantin Khorenko khorenko at virtuozzo.com
Tue Sep 28 19:17:30 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 9ca77fcc0d75ade56de75e1e66f7a7712f1351a1
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Sep 28 19:17:29 2021 +0300

    push_backup: Take rwsem killable
    
    ... to have possibility to kill process.
    
    To_merge: 69eac404315a ("dm: Add push backup driver")
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-push-backup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
index 75f080fe34cf..6d7b1859298a 100644
--- a/drivers/md/dm-push-backup.c
+++ b/drivers/md/dm-push-backup.c
@@ -578,9 +578,11 @@ static int pb_message(struct dm_target *ti, unsigned int argc, char **argv,
 
 	read = msg_wants_down_read(argv[0]);
 	if (read)
-		down_read(&pb->ctl_rwsem);
+		ret = down_read_killable(&pb->ctl_rwsem);
 	else
-		down_write(&pb->ctl_rwsem);
+		ret = down_write_killable(&pb->ctl_rwsem);
+	if (unlikely(ret))
+		goto out;
 
 	if (!strcmp(argv[0], "push_backup_start")) {
 		if (argc < 2 || argc > 3)


More information about the Devel mailing list