Forráskód Böngészése

ext4: fix lazytime optimization

We had a fencepost error in the lazytime optimization which means that
timestamp would get written to the wrong inode.

Cc: stable@vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o 10 éve
szülő
commit
8f4d855839
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      fs/ext4/inode.c

+ 1 - 1
fs/ext4/inode.c

@@ -4345,7 +4345,7 @@ static void ext4_update_other_inodes_time(struct super_block *sb,
 	int inode_size = EXT4_INODE_SIZE(sb);
 	int inode_size = EXT4_INODE_SIZE(sb);
 
 
 	oi.orig_ino = orig_ino;
 	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) {
 	for (i = 0; i < inodes_per_block; i++, ino++, buf += inode_size) {
 		if (ino == orig_ino)
 		if (ino == orig_ino)
 			continue;
 			continue;