Whamcloud - gitweb
resize2fs: fix to respect the environment variable E2FSPROGS_FAKE_TIME
authorTheodore Ts'o <tytso@mit.edu>
Thu, 4 Aug 2022 19:18:15 +0000 (15:18 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 4 Aug 2022 19:18:15 +0000 (15:18 -0400)
commit0288b1fd6909e92e3668dde8f1f6401fdabd1494
tree612357dd1eb2125a4a05dd18b9016d65c06dc4e4
parent6772d4969e9c90460945bbf02b87c227b93a9832
resize2fs: fix to respect the environment variable E2FSPROGS_FAKE_TIME

When performing an off-line resize, if an inode's block map needs to
be updated, resize2fs will update the inode's ctime.  In addition, if
inode numbers need to be renumbered due to the file system shrinking
forcing the inode table to be shrunk, any directories which need to be
modified will have their ctime and mtime updated.

If the E2FSPROGS_FAkE_TIME environment variable is set, when the file
system is opened, fs->now will be set to this value, and resize2fs
needs to use it instead of calling time(0) to get their current time.

Addresses-Google-Bug: 230874381
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/resize2fs.c