]> www.infradead.org Git - users/jedix/linux-maple.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)
committerMikulas Patocka <mpatocka@redhat.com>
Tue, 13 Aug 2024 11:50:45 +0000 (13:50 +0200)
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
drivers/md/dm.c

index 97fab2087df86d5b0fba0dc4ce5125499e4b4ca6..87bb903034358234b3112bc9695a9b46403838d7 100644 (file)
@@ -2737,7 +2737,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;
                }
 
@@ -2762,7 +2762,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;
                }