[PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests
From: Konstantin Khlebnikov
Date: Mon May 04 2020 - 11:55:03 EST
For some reason NOWAIT currently is passed only for writes.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx>
Fixes: 03a07c92a9ed ("block: return on congested block device")
---
fs/direct-io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 00b4d15bb811..dbb6afef6be9 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1234,11 +1234,11 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
if (iov_iter_rw(iter) == WRITE) {
dio->op = REQ_OP_WRITE;
dio->op_flags = REQ_SYNC | REQ_IDLE;
- if (iocb->ki_flags & IOCB_NOWAIT)
- dio->op_flags |= REQ_NOWAIT;
} else {
dio->op = REQ_OP_READ;
}
+ if (iocb->ki_flags & IOCB_NOWAIT)
+ dio->op_flags |= REQ_NOWAIT;
if (iocb->ki_flags & IOCB_HIPRI)
dio->op_flags |= REQ_HIPRI;