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 <dgurya...@parallels.com>
Acked-by: Dmitry Monakhov <dmonak...@openvz.org>
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org>
---
 fs/open.c |   10 +++++-----
 1 files 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;
-- 
1.7.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to