-
Bug
-
Resolution: Fixed
-
Medium
-
None
-
None
-
ldiskfs MDT with DoM
-
3
-
9223372036854775807
Splitting off a mirror that has a DoM component (lfs mirror split -d, or LL_LEASE_LAYOUT_SPLIT) sets the file's mtime to the time of the split. lfs migrate of a DoM file to a layout without DoM does the same. A split of a mirror without DoM keeps the mtime. Tools that release the flash mirror of cold files change the mtime of every file they release, and backups see them as modified.
Reproducer
ldiskfs MDT, two OSTs:
lfs setstripe -E 64K -L mdt -E eof -c 1 f dd if=/dev/urandom of=f bs=128K count=1 touch -d "2020-01-01 12:00" f lfs mirror extend -N -c 1 f lfs mirror split -d --mirror-id=1 f stat -c %Y f # the time of the split, not 1577876400
Cause
mdd_dom_fixup() punches the DoM data on the MDT. ldiskfs_truncate() updates the times with i_mtime = i_ctime = current_time(), which for the NOCMTIME inodes of osd-ldiskfs (ext4-nocmtime.patch) copies the ctime into the mtime. Since LU-10048 the truncate runs from osd_trans_stop() after the punch transaction, so it also replaces the mtime a caller set in that transaction. osd-zfs changes no times on a punch. lfs restores no times around a split (LU-14508 covers extend and resync only), and a restore in userspace after the split races with writes.
Fix
A truncate in ldiskfs should not change the times of Lustre's NOCMTIME inodes: the caller sets the times it wants in the punch transaction, as on osd-zfs. Test: sanity-flr test_61d.