ext4: fix fencepost error in lazytime optimization
authorTheodore Ts'o <tytso@mit.edu>
Thu, 2 Jul 2015 03:37:46 +0000 (23:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:00 +0000 (09:29 -0700)
commitae82e119e810848c6596031c1bed8c9a38e70322
tree2d7de71ff5ae87d2ea7e5976087bc089c598b73d
parent1c1964376ab16bc80dc24db2972a9d8f9120c9a4
ext4: fix fencepost error in lazytime optimization

commit 0f0ff9a9f3fa2ec6f427603fd521d5f3a0b076d1 upstream.

Commit 8f4d8558391: "ext4: fix lazytime optimization" was not a
complete fix.  In the case where the inode number is a multiple of 16,
and we could still end up updating an inode with dirty timestamps
written to the wrong inode on disk.  Oops.

This can be easily reproduced by using generic/005 with a file system
with metadata_csum and lazytime enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c