diff options
author | Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> | 2015-12-15 19:41:31 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-09 02:55:37 -0500 |
commit | 0dbf5f20652108106cb822ad7662c786baaa03ff (patch) | |
tree | b49fa7310ed588939e67ce97ed39fd9682da59e0 /fs/fcntl.c | |
parent | 90330e689c32e5105265c461c54af6ecec3373fa (diff) | |
download | op-kernel-dev-0dbf5f20652108106cb822ad7662c786baaa03ff.zip op-kernel-dev-0dbf5f20652108106cb822ad7662c786baaa03ff.tar.gz |
fcntl: allow to set O_DIRECT flag on pipe
With packetized mode for pipes, it's not possible to set O_DIRECT on pipe file
via sys_fcntl, because of unsupported sanity checks.
Ability to set this flag will be used by CRIU to migrate packetized pipes.
v2:
Fixed typos and mode variable to check.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -51,7 +51,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg) if (arg & O_NDELAY) arg |= O_NONBLOCK; - if (arg & O_DIRECT) { + /* Pipe packetized mode is controlled by O_DIRECT flag */ + if (!S_ISFIFO(filp->f_inode->i_mode) && (arg & O_DIRECT)) { if (!filp->f_mapping || !filp->f_mapping->a_ops || !filp->f_mapping->a_ops->direct_IO) return -EINVAL; |