Commit df8c2d13 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'vfs/v6.4-rc1/pipe' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs

Pull vfs fix from Christian Brauner:
 "During the pipe nonblock rework the check for both O_NONBLOCK and
  IOCB_NOWAIT was dropped. Both checks need to be performed to ensure
  that files without O_NONBLOCK but IOCB_NOWAIT don't block when writing
  to or reading from a pipe.

  This just contains the fix adding the check for IOCB_NOWAIT back in"

* tag 'vfs/v6.4-rc1/pipe' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
  pipe: check for IOCB_NOWAIT alongside O_NONBLOCK
parents 584dc5db c04fe8e3
...@@ -342,7 +342,8 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to) ...@@ -342,7 +342,8 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
break; break;
if (ret) if (ret)
break; break;
if (filp->f_flags & O_NONBLOCK) { if ((filp->f_flags & O_NONBLOCK) ||
(iocb->ki_flags & IOCB_NOWAIT)) {
ret = -EAGAIN; ret = -EAGAIN;
break; break;
} }
...@@ -547,7 +548,8 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from) ...@@ -547,7 +548,8 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
continue; continue;
/* Wait for buffer space to become available. */ /* 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) if (!ret)
ret = -EAGAIN; ret = -EAGAIN;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment