Yes, You're right!
After further testing, I found that in some test cases, the timestamps are not being updated on MDT.
In the previous tests, the reason that the timestamps were updated is the command "dd if=/dev/zero of=/mnt/lustre/test bs=1k count=2" truncates the file when open the file.
After add the "conv=notrunc", the timestamps are difference.
[root@qian tests]# dd if=/dev/zero of=/mnt/lustre/test bs=1k count=2 conv=notrunc
2+0 records in
2+0 records out
2048 bytes (2.0 kB) copied, 0.00368011 s, 557 kB/s
[root@qian tests]# stat /mnt/lustre/test
File: '/mnt/lustre/test'
Size: 2048 Blocks: 8 IO Block: 4194304 regular file
Device: 2c54f966h/743766374d Inode: 144115205272502273 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:unlabeled_t:s0
Access: 2019-09-24 10:59:52.000000000 +0800
Modify: 2019-09-24 21:28:32.000000000 +0800
Change: 2019-09-24 21:28:32.000000000 +0800
Birth: -
[root@qian tests]# debugfs -c -R 'stat ROOT/test' /dev/mapper/mds1_flakey
debugfs 1.45.2.wc1 (27-May-2019)
/dev/mapper/mds1_flakey: catastrophic mode - not reading inode or group bitmaps
Inode: 162 Type: regular Mode: 0644 Flags: 0x0
Generation: 667952766 Version: 0x00000001:00000001
User: 0 Group: 0 Project: 0 Size: 0
File ACL: 0
Links: 1 Blockcount: 0
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x5d8994b8:00000000 -- Tue Sep 24 11:59:52 2019
atime: 0x5d8986a8:9963a170 -- Tue Sep 24 10:59:52 2019
mtime: 0x5d8994b8:00000000 -- Tue Sep 24 11:59:52 2019
crtime: 0x5d8986a8:9963a170 -- Tue Sep 24 10:59:52 2019
Size of extra inode fields: 32
Extended attributes:
trusted.lma (24) = 00 00 00 00 00 00 00 00 01 04 00 00 02 00 00 00 01 00 00 00
00 00 00 00
lma: fid=[0x200000401:0x1:0x0] compat=0 incompat=0
trusted.lov (56)
security.selinux (37) = "unconfined_u:object_r:unlabeled_t:s0\000"
trusted.link (46)
trusted.som (24) = 04 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 08 00 00 00
00 00 00 00
BLOCKS:
I will patch the llite and MDT code to make it update mtime and ctime accordingly.
Regards,
Qian
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36869/
Subject:
LU-12026mdt: MDS stores atime|mtime|ctime during closeProject: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: b67e307f2d332c2ab1643aaa04c19c024a37b22a