Skip to contentSkip to conversation

IS_NOCMTIME and setting of ctime and mtime on remote servers

DISCUSSION Steve French 3 participants 3 messages Aug 29, 2005 VFS

lore
Share & tools
lore
#0 lore raw

NFS is the only place that sets NOCMTIME on inodes in its fhget routine IIRC.

What is the exact intent of this? Does it stay set (so mtime and ctime updates are never sent to the server) or does it get reset somewhere (I did not see where nfs turned it off so presumably even explicit sets of the time are ignored by default?)?

I realize that some users would prefer that an fs never set the file times to the remote server (at least for the cifs and nfs cases I have heard this in past years) as the server will set them implicitly anyway (and it can help performance). For cached files the local times in the client's version of the inode could be used indefinately (at least while the file is cacheable on the client, continuing to hold the caching token/oplock).

I saw a thread on bsd mailing list from a few years ago in which some users were asking for a mount flag (nocmtime) to turn off ctime and mtime updates for much the same reason.

#1 lore raw
Quoted 2 lines

NFS is the only place that sets NOCMTIME on inodes in its fhget routine IIRC.

FUSE too.

Quoted 4 lines

What is the exact intent of this? Does it stay set (so mtime and ctime updates are never sent to the server) or does it get reset somewhere (I did not see where nfs turned it off so presumably even explicit sets of the time are ignored by default?)?

I don't think it gets reset.

Quoted 7 lines

I realize that some users would prefer that an fs never set the file times to the remote server (at least for the cifs and nfs cases I have heard this in past years) as the server will set them implicitly anyway (and it can help performance). For cached files the local times in the client's version of the inode could be used indefinately (at least while the file is cacheable on the client, continuing to hold the caching token/oplock).

It's not just performance: for network filsystems you usually want to set the file times according to the server clock. That way there'd be some consitency even if the client's clock is out of sync.

Miklos

#2 lore raw
In reply to Steve French

må den 29.08.2005 Klokka 12:16 (-0500) skreiv Steve French:

Quoted 7 lines

NFS is the only place that sets NOCMTIME on inodes in its fhget routine IIRC.

What is the exact intent of this? Does it stay set (so mtime and ctime updates are never sent to the server) or does it get reset somewhere (I did not see where nfs turned it off so presumably even explicit sets of the time are ignored by default?)?

NOCMTIME just turns off the inode_update_time() crapola. It has nothing to do with explicit sets of the time which are done through the utimes() syscall.

IOW: it turns off all those unwanted VFS updates of mtime/ctime which would otherwise screw up data and metadata cache revalidation.

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html