Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1292308
| From | Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] fcntl: allow to set O_DIRECT flag on pipe |
| Date | 2015-12-15 17:00 +0100 |
| Message-ID | <qG0b9-6bS-43@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
With packetized mode for pipes, it's not possible to set O_DIRECT on pipe file
via sys_fcntl, because of unsupported (by pipes) sanity checks.
Ability to set this flag will be used by CRIU to migrate packetized pipes.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
fs/fcntl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ee85cd4..4463a87 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -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 (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
if (!filp->f_mapping || !filp->f_mapping->a_ops ||
!filp->f_mapping->a_ops->direct_IO)
return -EINVAL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] fcntl: allow to set O_DIRECT flag on pipe Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> - 2015-12-15 17:00 +0100 Re: [PATCH] fcntl: allow to set O_DIRECT flag on pipe kbuild test robot <lkp@intel.com> - 2015-12-15 17:20 +0100 Re: [PATCH] fcntl: allow to set O_DIRECT flag on pipe kbuild test robot <lkp@intel.com> - 2015-12-15 17:20 +0100
csiph-web