|
|
Log in / Subscribe / Register

Rethinking multi-grain timestamps

Rethinking multi-grain timestamps

Posted Oct 9, 2023 15:55 UTC (Mon) by tux3 (subscriber, #101245)
Parent article: Rethinking multi-grain timestamps

>Timestamps are carefully truncated before being reported to user space, though, so that the higher resolution is not visible outside of the virtual filesystem layer. That should prevent problems like the one described above.

I may be confused, but is it really enough?

Say I write file 1 from userspace, locally, I do steps 2, 3, 4 on file 2 from NFS.
Now, a local program watches file 2, sees that it has been written, and responds by updating write file 1 (locally).

On the other side of the NFS, maybe I am waiting to see a file 1 update, because I expect the watcher program to respond.
Can it happen that I see file 1 written before file 2, because file 1 got a low-res timestamp, but NFS still returns me a high-resolution file 2 timestamp, and so I wait forever?


to post comments

Rethinking multi-grain timestamps

Posted Oct 10, 2023 13:54 UTC (Tue) by spacefrogg (subscriber, #119608) [Link]

This could only be a problem under the assumption that both modifications are less time apart than the lower time resolution (less precise timestamp). In such cases (last I know of is FAT), timestamps must be considered unreliable and disregarded or treated in an application-specific way.

Without knowing any specifics, I don't think that this is an issue, here.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds