Thread (39 messages) 39 messages, 5 authors, 2022-01-02

Re: [PATCH v5 1/4] md: add support for REQ_NOWAIT

flat view

From: Song Liu <song@kernel.org>
Date: 2021-12-15 20:02:24

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help