]> www.infradead.org Git - users/jedix/linux-maple.git/commit
block: do not use interruptible wait anywhere
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 12 Apr 2018 18:11:58 +0000 (19:11 +0100)
committerBrian Maly <brian.maly@oracle.com>
Wed, 12 Jun 2019 15:19:26 +0000 (11:19 -0400)
commit75d91423f4af9c351d2d5541fe96e3ba53d07d17
tree4ed36fda5d62a69a1de6849c99819231af1be8f8
parent15a48cc22bf0343432461c973c08ff293453a2cf
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 3a0a529971ec
("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 3ef28e83ab15 ("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 <bart.vanassche@wdc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 1dc3039bc87ae7d19a990c3ee71cfd8a9068f428)

Orabug: 29674055

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Wengang Wang <wen.gang.wang@oracle.com>
 Conflicts:
block/blk-core.c

Signed-off-by: Brian Maly <brian.maly@oracle.com>
block/blk-core.c