[Devel] [PATCH RHEL7 COMMIT] ve: remove sysctl_fsync_enable and use ve_fsync_behavior instead
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Jun 30 07:28:40 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.23
------>
commit 2b6dedde84ac726be4d49bd6ce59b17b232fbe05
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date: Tue Jun 30 18:28:40 2015 +0400
ve: remove sysctl_fsync_enable and use ve_fsync_behavior instead
Patchset description:
ve: fix initialization and remove sysctl_fsync_enable
v2:
- initialize only on ve cgroup creation, remove get_ve_features
- rename setup_iptables_mask into ve_setup_iptables_mask
https://jira.sw.ru/browse/PSBM-34286
https://jira.sw.ru/browse/PSBM-34285
Pavel Tikhomirov (4):
ve: remove sysctl_fsync_enable and use ve_fsync_behavior instead
ve: initialize fsync_enable also for non ve0 environment
ve: iptables: fix mask initialization and changing
ve: cgroup: initialize odirect_enable, features and _randomize_va_space
=====================================================================
This patch description:
- sysctl_fsync_enable is always = 2 and checking it is meaningless
- we already changed it with ve_fsync_behavior in setfl and dentry_open
- in do_fsync and syncfs we have both checks
- in msync replace
- in sync_file_range we don't need replacement according to patch
diff-ve-fsync-behavior-sanitize:
* Don't filter syncs in sync_file_range, since this syscall is
not technically sync, then name is misleading
Reviewed-by: Vladimir Davydov <vdavydov at parallels.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Acked-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
fs/sync.c | 9 ---------
include/linux/fs.h | 1 -
mm/msync.c | 2 +-
3 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/fs/sync.c b/fs/sync.c
index 561d2f4..331e8de 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -24,8 +24,6 @@
#define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \
SYNC_FILE_RANGE_WAIT_AFTER)
-int sysctl_fsync_enable = 2;
-
/*
* Do the filesystem syncing work. For simple filesystems
* writeback_inodes_sb(sb) just dirties buffers with inodes so we have to
@@ -327,8 +325,6 @@ SYSCALL_DEFINE1(syncfs, int, fd)
if (is_child_reaper(task_pid(current)))
goto fdput;
- if (!sysctl_fsync_enable)
- goto fdput;
fsb = __ve_fsync_behavior(ve);
if (fsb == FSYNC_NEVER)
goto fdput;
@@ -413,8 +409,6 @@ static int do_fsync(unsigned int fd, int datasync)
struct fd f;
int ret = -EBADF;
- if (!ve_is_super(get_exec_env()) && !sysctl_fsync_enable)
- return 0;
if (ve_fsync_behavior() == FSYNC_NEVER)
return 0;
@@ -510,9 +504,6 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
loff_t endbyte; /* inclusive */
umode_t i_mode;
- if (!ve_is_super(get_exec_env()) && !sysctl_fsync_enable)
- return 0;
-
ret = -EINVAL;
if (flags & ~VALID_FLAGS)
goto out;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a6bebb4..055e056 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -58,7 +58,6 @@ extern struct inodes_stat_t inodes_stat;
extern int leases_enable, lease_break_time;
extern int sysctl_protected_symlinks;
extern int sysctl_protected_hardlinks;
-extern int sysctl_fsync_enable;
struct buffer_head;
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
diff --git a/mm/msync.c b/mm/msync.c
index b7d634a..f47b2d7 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -48,7 +48,7 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
if (end < start)
goto out;
error = 0;
- if (!ve_is_super(get_exec_env()) && !sysctl_fsync_enable)
+ if (ve_fsync_behavior() == FSYNC_NEVER)
goto out;
if (end == start)
goto out;
More information about the Devel
mailing list