Skip to content

Commit 75d9142

Browse files
sourcejediBrian Maly
authored andcommitted
block: do not use interruptible wait anywhere
When blk_queue_enter() waits for a queue to unfreeze, or unset the PREEMPT_ONLY flag, do not allow it to be interrupted by a signal. The PREEMPT_ONLY flag was introduced later in commit 3a0a529 ("block, scsi: Make SCSI quiesce and resume work reliably"). Note the SCSI device is resumed asynchronously, i.e. after un-freezing userspace tasks. So that commit exposed the bug as a regression in v4.15. A mysterious SIGBUS (or -EIO) sometimes happened during the time the device was being resumed. Most frequently, there was no kernel log message, and we saw Xorg or Xwayland killed by SIGBUS.[1] [1] E.g. https://bugzilla.redhat.com/show_bug.cgi?id=1553979 Without this fix, I get an IO error in this test: while killall -SIGUSR1 dd; do sleep 0.1; done & \ echo mem > /sys/power/state ; \ sleep 5; killall dd # stop after 5 seconds The interruptible wait was added to blk_queue_enter in commit 3ef28e8 ("block: generic request_queue reference counting"). Before then, the interruptible wait was only in blk-mq, but I don't think it could ever have been correct. Reviewed-by: Bart Van Assche <[email protected]> Cc: [email protected] Signed-off-by: Alan Jenkins <[email protected]> Signed-off-by: Jens Axboe <[email protected]> (cherry picked from commit 1dc3039) Orabug: 29674055 Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Wengang Wang <[email protected]> Conflicts: block/blk-core.c Signed-off-by: Brian Maly <[email protected]>
1 parent 15a48cc commit 75d9142

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

block/blk-core.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,21 +612,17 @@ EXPORT_SYMBOL(blk_alloc_queue);
612612
int blk_queue_enter(struct request_queue *q, gfp_t gfp)
613613
{
614614
while (true) {
615-
int ret;
616-
617615
if (percpu_ref_tryget_live(&q->q_usage_counter))
618616
return 0;
619617

620618
if (!(gfp & __GFP_WAIT))
621619
return -EBUSY;
622620

623-
ret = wait_event_interruptible(q->mq_freeze_wq,
621+
wait_event(q->mq_freeze_wq,
624622
!atomic_read(&q->mq_freeze_depth) ||
625623
blk_queue_dying(q));
626624
if (blk_queue_dying(q))
627625
return -ENODEV;
628-
if (ret)
629-
return ret;
630626
}
631627
}
632628

0 commit comments

Comments
 (0)