[Devel] [PATCH RHEL8 COMMIT] ve/msync: fix wrong behaviour of fs.fsync-enable

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jul 15 11:15:04 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.54
------>
commit f9587faf95363776c184f31806a03f77800f109b
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Thu Jul 15 11:15:03 2021 +0300

    ve/msync: fix wrong behaviour of fs.fsync-enable
    
    When FSYNC_NEVER is set in container (in fs.fsync-enable sysctl) syncs
    should be ignored instead of failing with ENOMEM as we have now.
    
    https://jira.sw.ru/browse/PSBM-131652
    
    Fixes: a3d65258a0a1 ("ve/fs/sync: Per containter sync and syncfs and
    fs.fsync-enable sysctl")
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    Acked-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
---
 mm/msync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/msync.c b/mm/msync.c
index 3a79d8f2be4d..c329fee0fd6c 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -48,9 +48,9 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
 	end = start + len;
 	if (end < start)
 		goto out;
+	error = 0;
 	if (ve_fsync_behavior() == FSYNC_NEVER)
 		goto out;
-	error = 0;
 	if (end == start)
 		goto out;
 	/*


More information about the Devel mailing list