]> git.hungrycats.org Git - linux/commitdiff
ext4: fix lazytime optimization
authorTheodore Ts'o <tytso@mit.edu>
Thu, 14 May 2015 22:19:01 +0000 (18:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Jun 2015 15:21:01 +0000 (08:21 -0700)
commit 8f4d855839179f410fa910a26eb81d646d628f26 upstream.

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@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c

index 852cc521f327a0cb6a13abe692f7b80e4fd0334d..1f252b4e0f51dc7fc9d7fa97c4d3516b4fcd72f8 100644 (file)
@@ -4233,7 +4233,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;