Whamcloud - gitweb
e2fsck: fix inode coherency issue when iterating an inode's blocks
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 18 Jul 2014 22:53:11 +0000 (15:53 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 22 Jul 2014 18:53:21 +0000 (14:53 -0400)
commit23d6dd1f1032af47d9a8cc7e9ecc1ec7a9b95718
tree68e9931aa3b0d7bef5c2353514b5d84293cc6680
parent7722961d2c4c327d45b9c42dd29e8231cc0e1c4b
e2fsck: fix inode coherency issue when iterating an inode's blocks

When we're about to iterate the blocks of a block-map file, we need to
write the inode out to disk if it's dirty because block_iterate3()
will re-read the inode from disk.  (In practice this won't happen
because nothing dirties block-mapped inodes before the iterate call,
but we can program defensively).

More importantly, we need to re-read the inode after the iterate()
operation because it's possible that mappings were changed (or erased)
during the iteration.  If we then dirty or clear the inode, we'll
mistakenly write the old inode values back out to disk!

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c