lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 12 Dec 2017 13:34:20 -0500
From:   Martin Brandenburg <martin@...ibond.com>
To:     hubcap@...ibond.com, devel@...ts.orangefs.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Martin Brandenburg <martin@...ibond.com>
Subject: [PATCH 14/18] orangefs: implement direct_IO for the read case

From: Martin Brandenburg <martin@...ibond.com>

Since orangefs_file_read_iter now calls generic_file_read_iter, O_DIRECT
now goes through direct_IO in the read case.  In the write case,
orangefs_file_write_iter never calls direct_IO, but handles the direct
write manually.

Signed-off-by: Martin Brandenburg <martin@...ibond.com>
---
 fs/orangefs/file.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 1c30e9abb8cb..0223a0351d11 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -787,22 +787,17 @@ static int orangefs_releasepage(struct page *page, gfp_t foo)
 	return 0;
 }
 
-/*
- * Having a direct_IO entry point in the address_space_operations
- * struct causes the kernel to allows us to use O_DIRECT on
- * open. Nothing will ever call this thing, but in the future we
- * will need to be able to use O_DIRECT on open in order to support
- * AIO. Modeled after NFS, they do this too.
- */
-
 static ssize_t orangefs_direct_IO(struct kiocb *iocb,
 				  struct iov_iter *iter)
 {
-	gossip_debug(GOSSIP_INODE_DEBUG,
-		     "orangefs_direct_IO: %pD\n",
-		     iocb->ki_filp);
-
-	return -EINVAL;
+	struct file *file = iocb->ki_filp;
+	loff_t pos = *(&iocb->ki_pos);
+	/*
+	 * This cannot happen until write_iter becomes
+	 * generic_file_write_iter.
+	 */
+	BUG_ON(iov_iter_rw(iter) != READ);
+	return do_readv_writev(ORANGEFS_IO_READ, file, &pos, iter);
 }
 
 /** ORANGEFS2 implementation of address space operations */
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ