From: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx> Return EAGAIN in case RAID5 would block because of waiting due to reshaping. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx> --- drivers/md/raid5.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 928e24a07133..707a3907d100 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5601,6 +5601,13 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) last_sector = bio_end_sector(bi); bi->bi_next = NULL; + if ((bi->bi_opf & REQ_NOWAIT) && + conf->reshape_progress != MaxSector && + (mddev->reshape_backwards ? logical_sector < conf->reshape_safe : last_sector >= conf->reshape_safe)) { + bio_wouldblock_error(bi); + return true; + } + prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE); for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { int previous; -- 2.14.2