If we have tons of read-ahead coming in and the process is getting
killed, then it can take forever to kill said process since each
IO could take seconds on a loaded rotating drive.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
#include <linux/blk-cgroup.h>
#include <linux/debugfs.h>
#include <linux/bpf.h>
+#include <linux/sched/signal.h>
#define CREATE_TRACE_POINTS
#include <trace/events/block.h>
if (bio_has_data(bio)) {
unsigned int count;
+ if (unlikely((bio->bi_opf & REQ_RAHEAD) &&
+ fatal_signal_pending(current))) {
+ bio->bi_status = BLK_STS_AGAIN;
+ bio_endio(bio);
+ return BLK_QC_T_NONE;
+ }
+
if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME))
count = queue_logical_block_size(bio->bi_disk->queue) >> 9;
else