[Devel] [PATCH RHEL7 COMMIT] ve/fs: check container odirect and fsync settings in __dentry_open

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jun 24 13:55:48 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.17
------>
commit 0432cfaa511977f7e85c788b0aa54f143002f6bd
Author: Dmitry Monakhov <dmonakhov at openvz.org>
Date:   Thu Jun 25 00:55:45 2015 +0400

    ve/fs: check container odirect and fsync settings in __dentry_open
    
    sys_open for conventional filesystems doesn't call dentry_open,
    it calls __dentry_open (in nameidata_to_filp), so we have to move
    checks for odirect and fsync behaviour to __dentry_open
    to make them working on ploop containers.
    
    https://jira.sw.ru/browse/PSBM-17157
    
    Signed-off-by: Dmitry Guryanov <dguryanov at parallels.com>
    
    Acked-by: Dmitry Monakhov <dmonakhov at openvz.org>
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 fs/open.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 435794f..d64cfad 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -683,6 +683,11 @@ static int do_dentry_open(struct file *f,
 	struct inode *inode;
 	int error;
 
+	if (!may_use_odirect())
+		f->f_flags &= ~O_DIRECT;
+	if (ve_fsync_behavior() == FSYNC_NEVER)
+		f->f_flags &= ~O_SYNC;
+
 	f->f_mode = OPEN_FMODE(f->f_flags) | FMODE_LSEEK |
 				FMODE_PREAD | FMODE_PWRITE;
 
@@ -824,11 +829,6 @@ struct file *dentry_open(const struct path *path, int flags,
 	/* We must always pass in a valid mount pointer. */
 	BUG_ON(!path->mnt);
 
-	if (!may_use_odirect())
-		flags &= ~O_DIRECT;
-	if (ve_fsync_behavior() == FSYNC_NEVER)
-		flags &= ~O_SYNC;
-
 	f = get_empty_filp();
 	if (!IS_ERR(f)) {
 		f->f_flags = flags;



More information about the Devel mailing list