]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dm suspend: return -ERESTARTSYS instead of -EINTR
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 13 Aug 2024 10:38:51 +0000 (12:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2024 15:35:54 +0000 (17:35 +0200)
[ Upstream commit 1e1fd567d32fcf7544c6e09e0e5bc6c650da6e23 ]

This commit changes device mapper, so that it returns -ERESTARTSYS
instead of -EINTR when it is interrupted by a signal (so that the ioctl
can be restarted).

The manpage signal(7) says that the ioctl function should be restarted if
the signal was handled with SA_RESTART.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm.c

index 13037d6a6f62a25ab68295eb4160a4f6cf831161..6e15ac4e0845cdc6240bbc8395db1ee767e16f92 100644 (file)
@@ -2594,7 +2594,7 @@ static int dm_wait_for_bios_completion(struct mapped_device *md, unsigned int ta
                        break;
 
                if (signal_pending_state(task_state, current)) {
-                       r = -EINTR;
+                       r = -ERESTARTSYS;
                        break;
                }
 
@@ -2619,7 +2619,7 @@ static int dm_wait_for_completion(struct mapped_device *md, unsigned int task_st
                        break;
 
                if (signal_pending_state(task_state, current)) {
-                       r = -EINTR;
+                       r = -ERESTARTSYS;
                        break;
                }