Merge tag 'ffa-fix-6.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
[platform/kernel/linux-starfive.git] / fs / pipe.c
index ceb17d2..2d88f73 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -342,7 +342,8 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
                        break;
                if (ret)
                        break;
-               if (filp->f_flags & O_NONBLOCK) {
+               if ((filp->f_flags & O_NONBLOCK) ||
+                   (iocb->ki_flags & IOCB_NOWAIT)) {
                        ret = -EAGAIN;
                        break;
                }
@@ -547,7 +548,8 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
                        continue;
 
                /* Wait for buffer space to become available. */
-               if (filp->f_flags & O_NONBLOCK) {
+               if ((filp->f_flags & O_NONBLOCK) ||
+                   (iocb->ki_flags & IOCB_NOWAIT)) {
                        if (!ret)
                                ret = -EAGAIN;
                        break;