Skip to content

Commit 5bbbfdf

Browse files
nomuranecsnitm
authored andcommitted
dm: fix ioctl retry termination with signal
dm-mpath retries ioctl, when no path is readily available and the device is configured to queue I/O in such a case. If you want to stop the retry before multipathd decides to turn off queueing mode, you could send signal for the process to exit from the loop. However the check of fatal signal has not carried along when commit 6c182cd ("dm mpath: fix ioctl deadlock when no paths") moved the loop from dm-mpath to dm core. As a result, we can't terminate such a process in the retry loop. Easy reproducer of the situation is: # dmsetup create mp --table '0 1024 multipath 0 0 0 0' # dmsetup message mp 0 'queue_if_no_path' # sg_inq /dev/mapper/mp then you should be able to terminate sg_inq by pressing Ctrl+C. Fixes: 6c182cd ("dm mpath: fix ioctl deadlock when no paths") Signed-off-by: Jun'ichi Nomura <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Cc: [email protected]
1 parent 172c238 commit 5bbbfdf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/md/dm-mpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ static int multipath_prepare_ioctl(struct dm_target *ti,
15621562

15631563
spin_unlock_irqrestore(&m->lock, flags);
15641564

1565-
if (r == -ENOTCONN && !fatal_signal_pending(current)) {
1565+
if (r == -ENOTCONN) {
15661566
spin_lock_irqsave(&m->lock, flags);
15671567
if (!m->current_pg) {
15681568
/* Path status changed, redo selection */

drivers/md/dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static int dm_get_live_table_for_ioctl(struct mapped_device *md,
591591

592592
out:
593593
dm_put_live_table(md, *srcu_idx);
594-
if (r == -ENOTCONN) {
594+
if (r == -ENOTCONN && !fatal_signal_pending(current)) {
595595
msleep(10);
596596
goto retry;
597597
}

0 commit comments

Comments
 (0)