The commit is pushed to "branch-rh10-6.12.0-55.13.1.vz10.2.x-ovz" and will appear at g...@bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-55.13.1.el10 ------> commit 1ca6c74b0a3a29cf0017aa7158c742afcde0580f Author: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> Date: Thu Jul 31 18:06:30 2025 +0800
ext4: minor cleanup in ext4_mfsync * Use actual fd member shift in ext4_ioc_mfsync_info instead of hardcoded sizeof(__u32). * Add some spaces and new lines for readability. https://virtuozzo.atlassian.net/browse/VSTOR-107255 Fixes: 26337aacaafa9 ("ext4: add mfsync support") Signed-off-by: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> Feature: ext4: optimized sync of a set of files - mfsync() --- fs/ext4/ioctl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 66923dd1ddd4..738ed4d8cf5e 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -1292,6 +1292,7 @@ static int ext4_mfsync(unsigned long arg) if (!ve_is_super(get_exec_env())) return -ENOTSUPP; + if (copy_from_user(&mfsync, (struct ext4_ioc_mfsync_info *)arg, sizeof(mfsync))) return -EFAULT; @@ -1301,7 +1302,7 @@ static int ext4_mfsync(unsigned long arg) if (mfsync.size > NR_FILE) return -ENFILE; - usr_fd = (__u32 __user *) (arg + sizeof(__u32)); + usr_fd = (__u32 __user *)&((struct ext4_ioc_mfsync_info *)arg)->fd[0]; filpp = kzalloc(mfsync.size * sizeof(*filpp), GFP_KERNEL); if (!filpp) @@ -1311,6 +1312,7 @@ static int ext4_mfsync(unsigned long arg) kfree(filpp); return -ENOMEM; } + for (i = 0; i < mfsync.size; i++) { int fd; int ret; @@ -1321,8 +1323,8 @@ static int ext4_mfsync(unsigned long arg) goto mfsync_fput; /* negative fd means fdata_sync */ - flags[i] = (fd & (1<< 31)) != 0; - fd &= ~(1<< 31); + flags[i] = (fd & (1 << 31)) != 0; + fd &= ~(1 << 31); err = -EBADF; filpp[i] = fget(fd); _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel