mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fcntl: allow to set O_DIRECT flag on pipe
@ 2015-12-15 15:14 Stanislav Kinsburskiy
  2015-12-15 16:14 ` kbuild test robot
  2015-12-15 16:15 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Kinsburskiy @ 2015-12-15 15:14 UTC (permalink / raw)
  To: bfields, jlayton, viro; +Cc: linux-fsdevel, linux-kernel, devel

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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-15 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-15 15:14 [PATCH] fcntl: allow to set O_DIRECT flag on pipe Stanislav Kinsburskiy
2015-12-15 16:14 ` kbuild test robot
2015-12-15 16:15 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®