On Mon, 2006-04-24 at 10:40 -0400, Apps Lists wrote:
The test system is Centos 4.3 (Final) running kernel 2.6.9-34.ELsmp #1 SMP.
I tested this with NFS and local ext3. The mtime is initially set
On Mon, 2006-04-24 at 07:47 -0400, Apps Lists wrote: properly, but gets changed to current system time sometime later on in the copy process. I moved the mtime change code around and managed to work around this, although I'm sure there's a more elegant approach.
The patch is here on the list.
Umm. Where?
It did indeed make it to the list... Let me know if you don't have it and I'll resend privately.
Ok, saw it now. But doing it after link() is a bit too late. It's possible that another process could have seen the file at that point with the wrong timestamp. Also I don't think link() should update mtime, and it doesn't with me, neither with ext3 nor with NFS.
What if you try it manually?
stat somefile ln somefile somefile2 stat somefile2
Only "Change" time should have changed, "Access" and "Modify" should be the same. Or if you don't have stat, I guess ls -l is enough as long as the mtime is old enough..
Hi Timo.
I knew I was introducing a race condition, but needed a quick fix for testing. This isn't producton yet. :)
I also did the same tests you recommended prior to making the source change. The ln doesn't seem to affect mtime. There has to be something else going on... what, I have no idea.
For giggles, the "ln test" is below.
Steve
root@dev3.neonova.net:/root# touch dovecot-test
root@dev3.neonova.net:/root# stat dovecot-test
File: dovecot-test' Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: fd00h/64768d Inode: 16402 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2006-04-25 07:16:41.000000000 -0400 Modify: 2006-04-25 07:16:41.000000000 -0400 Change: 2006-04-25 07:16:41.000000000 -0400 root@dev3.neonova.net:/root# ln dovecot-test test-dovecot root@dev3.neonova.net:/root# stat test-dovecot File:
test-dovecot'
Size: 0 Blocks: 0 IO Block: 4096 regular empty
file
Device: fd00h/64768d Inode: 16402 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2006-04-25 07:16:41.000000000 -0400
Modify: 2006-04-25 07:16:41.000000000 -0400
Change: 2006-04-25 07:16:58.000000000 -0400
root@dev3.neonova.net:/root#