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

Konstantin Khorenko khorenko at virtuozzo.com
Tue Sep 28 19:19:43 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-305.3.1.vz8.7.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-305.3.1.vz8.7.14
------>
commit c90c31e9c2cc17d3d58541032096d277b7b73197
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Sep 28 19:19:43 2021 +0300

    push_backup: Take rwsem killable
    
    ... to have possibility to kill process.
    
    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