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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user