[PATCH 4.0 085/148] ext4: fix lazytime optimization

Greg Kroah-Hartman
2015-06-03T12:47:37Z

From: Theodore Ts'o <tytso@mit.edu>

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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4233,7 +4233,7 @@ static void ext4_update_other_inodes_tim
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;