On Tue, Dec 14, 2021 at 10:09 PM Vishal Verma [off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
Signed-off-by: Vishal Verma <redacted>
---
drivers/md/md.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7fbf6f0ac01b..5b4c28e0e1db 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -419,6 +419,12 @@ void md_handle_request(struct mddev *mddev, struct bio *bio)
if (is_suspended(mddev, bio)) {
DEFINE_WAIT(__wait);
for (;;) {
+ /* Bail out if REQ_NOWAIT is set for the bio */
+ if (bio->bi_opf & REQ_NOWAIT) {
+ rcu_read_unlock();
+ bio_wouldblock_error(bio);
+ return;
+ }
I moved this part to before the for (;;) loop. And applied to md-next.
Thanks,
Song