Skip to content

Commit df8c2d1

Browse files
committed
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
2 parents 584dc5d + c04fe8e commit df8c2d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/pipe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
342342
break;
343343
if (ret)
344344
break;
345-
if (filp->f_flags & O_NONBLOCK) {
345+
if ((filp->f_flags & O_NONBLOCK) ||
346+
(iocb->ki_flags & IOCB_NOWAIT)) {
346347
ret = -EAGAIN;
347348
break;
348349
}
@@ -547,7 +548,8 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
547548
continue;
548549

549550
/* Wait for buffer space to become available. */
550-
if (filp->f_flags & O_NONBLOCK) {
551+
if ((filp->f_flags & O_NONBLOCK) ||
552+
(iocb->ki_flags & IOCB_NOWAIT)) {
551553
if (!ret)
552554
ret = -EAGAIN;
553555
break;

0 commit comments

Comments
 (0)