[Devel] [PATCH RHEL7 COMMIT] ms/ext4: fix lazytime optimization

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 26 04:10:36 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.18
------>
commit dc3ecf039264be848fddc67976988307b10e649c
Author: Dmitry Monakhov <dmonakhov at openvz.org>
Date:   Fri Jun 26 15:10:36 2015 +0400

    ms/ext4: fix lazytime optimization
    
    ML-commit 8f4d855839179f410fa910a26eb81d646d628f26 Mon Sep 17 00:00:00 2001
    
    We had a fencepost error in the lazytime optimization which means that
    timestamp would get written to the wrong inode.
    
    Signed-off-by: Theodore Ts'o <tytso at mit.edu>
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
 fs/ext4/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 137e828..c0300e9 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4485,7 +4485,7 @@ static void ext4_update_other_inodes_time(struct super_block *sb,
 	int inode_size = EXT4_INODE_SIZE(sb);
 
 	oi.orig_ino = orig_ino;
-	ino = orig_ino & ~(inodes_per_block - 1);
+	ino = (orig_ino & ~(inodes_per_block - 1)) + 1;
 	for (i = 0; i < inodes_per_block; i++, ino++, buf += inode_size) {
 		if (ino == orig_ino)
 			continue;



More information about the Devel mailing list