]> 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>
Wed, 4 Sep 2024 11:17:39 +0000 (13:17 +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 dc8498b4b5c13445ad20f23b77f39d48f11405ca..b56ea42ab7d2bef29426fbde58899fe286e2f638 100644 (file)
@@ -2343,7 +2343,7 @@ static int dm_wait_for_bios_completion(struct mapped_device *md, long task_state
                        break;
 
                if (signal_pending_state(task_state, current)) {
-                       r = -EINTR;
+                       r = -ERESTARTSYS;
                        break;
                }
 
@@ -2368,7 +2368,7 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state)
                        break;
 
                if (signal_pending_state(task_state, current)) {
-                       r = -EINTR;
+                       r = -ERESTARTSYS;
                        break;
                }