Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v2] nfs(5): Treatment of *atime mount options
@ 2014-01-16 17:31 Chuck Lever
  2014-01-18 16:00 ` Steve Dickson
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2014-01-16 17:31 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

I was reminded recently that NFS treats file atime time stamps
differently than other filesystems.  It also ignores the generic
*atime mount options because it cannot support the atime semantics
of local filesystems.

We should document that somewhere.  nfs(5) seems like a logical
place for it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 utils/mount/nfs.man |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man
index 67031b5..2250963 100644
--- a/utils/mount/nfs.man
+++ b/utils/mount/nfs.man
@@ -1227,6 +1227,65 @@ If absolute cache coherence among clients is required,
 applications should use file locking. Alternatively, applications
 can also open their files with the O_DIRECT flag
 to disable data caching entirely.
+.SS "File timestamp maintainence"
+NFS servers are responsible for managing file and directory timestamps
+.RB ( atime ,
+.BR ctime ", and"
+.BR mtime ).
+When a file is accessed or updated on an NFS server,
+the file's timestamps are updated just like they would be on a filesystem
+local to an application.
+.P
+NFS clients cache file attributes, including timestamps.
+A file's timestamps are updated on NFS clients when its attributes
+are retrieved from the NFS server.
+Thus there may be some delay before timestamp updates
+on an NFS server appear to applications on NFS clients.
+.P
+To comply with the POSIX filesystem standard, the Linux NFS client
+relies on NFS servers to keep a file's
+.B mtime
+and
+.B ctime
+timestamps properly up to date.
+It does this by flushing local data changes to the server
+before reporting
+.B mtime
+to applications via system calls such as
+.BR stat (2).
+.P
+The Linux client handles
+.B atime
+updates more loosely, however.
+NFS clients maintain good performance by caching data,
+but that means that application reads, which normally update
+.BR atime ,
+are not reflected to the server where a file's
+.B atime
+is actually maintained.
+.P
+Because of this caching behavior,
+the Linux NFS client does not support generic atime-related mount options.
+See
+.BR mount (8)
+for details on these options.
+.P
+In particular, the
+.BR atime / noatime ,
+.BR diratime / nodiratime ,
+.BR relatime / norelatime ,
+and
+.BR strictatime / nostrictatime
+mount options have no effect on NFS mounts.
+.P
+.I /proc/mounts
+may report that the
+.B relatime
+mount option is set on NFS mounts, but in fact the
+.B atime
+semantics are always as described here, and are not like
+.B relatime
+semantics.
 .SS "Directory entry caching"
 The Linux NFS client caches the result of all NFS LOOKUP requests.
 If the requested directory entry exists on the server,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nfs(5): Treatment of *atime mount options
  2014-01-16 17:31 [PATCH v2] nfs(5): Treatment of *atime mount options Chuck Lever
@ 2014-01-18 16:00 ` Steve Dickson
  2014-01-18 16:25   ` Chuck Lever
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Dickson @ 2014-01-18 16:00 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

On 16/01/14 12:31, Chuck Lever wrote:
> I was reminded recently that NFS treats file atime time stamps
> differently than other filesystems.  It also ignores the generic
> *atime mount options because it cannot support the atime semantics
> of local filesystems.
> 
> We should document that somewhere.  nfs(5) seems like a logical
> place for it.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
I'm a bit confused... What is the different between this patch
and the one you posted back in Nov 18
   http://www.spinics.net/lists/linux-nfs/msg40559.html
which turned to commit

  commit f41c591f8f4d492ee84994bb86810fb90bef8d4b
  Author: Chuck Lever <chuck.lever@oracle.com>
  Date:   Wed Nov 20 14:10:06 2013 -0500

steved.
> ---
>  utils/mount/nfs.man |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man
> index 67031b5..2250963 100644
> --- a/utils/mount/nfs.man
> +++ b/utils/mount/nfs.man
> @@ -1227,6 +1227,65 @@ If absolute cache coherence among clients is required,
>  applications should use file locking. Alternatively, applications
>  can also open their files with the O_DIRECT flag
>  to disable data caching entirely.
> +.SS "File timestamp maintainence"
> +NFS servers are responsible for managing file and directory timestamps
> +.RB ( atime ,
> +.BR ctime ", and"
> +.BR mtime ).
> +When a file is accessed or updated on an NFS server,
> +the file's timestamps are updated just like they would be on a filesystem
> +local to an application.
> +.P
> +NFS clients cache file attributes, including timestamps.
> +A file's timestamps are updated on NFS clients when its attributes
> +are retrieved from the NFS server.
> +Thus there may be some delay before timestamp updates
> +on an NFS server appear to applications on NFS clients.
> +.P
> +To comply with the POSIX filesystem standard, the Linux NFS client
> +relies on NFS servers to keep a file's
> +.B mtime
> +and
> +.B ctime
> +timestamps properly up to date.
> +It does this by flushing local data changes to the server
> +before reporting
> +.B mtime
> +to applications via system calls such as
> +.BR stat (2).
> +.P
> +The Linux client handles
> +.B atime
> +updates more loosely, however.
> +NFS clients maintain good performance by caching data,
> +but that means that application reads, which normally update
> +.BR atime ,
> +are not reflected to the server where a file's
> +.B atime
> +is actually maintained.
> +.P
> +Because of this caching behavior,
> +the Linux NFS client does not support generic atime-related mount options.
> +See
> +.BR mount (8)
> +for details on these options.
> +.P
> +In particular, the
> +.BR atime / noatime ,
> +.BR diratime / nodiratime ,
> +.BR relatime / norelatime ,
> +and
> +.BR strictatime / nostrictatime
> +mount options have no effect on NFS mounts.
> +.P
> +.I /proc/mounts
> +may report that the
> +.B relatime
> +mount option is set on NFS mounts, but in fact the
> +.B atime
> +semantics are always as described here, and are not like
> +.B relatime
> +semantics.
>  .SS "Directory entry caching"
>  The Linux NFS client caches the result of all NFS LOOKUP requests.
>  If the requested directory entry exists on the server,
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nfs(5): Treatment of *atime mount options
  2014-01-18 16:00 ` Steve Dickson
@ 2014-01-18 16:25   ` Chuck Lever
  0 siblings, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2014-01-18 16:25 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing List


On Jan 18, 2014, at 11:00 AM, Steve Dickson <SteveD@redhat.com> wrote:

> On 16/01/14 12:31, Chuck Lever wrote:
>> I was reminded recently that NFS treats file atime time stamps
>> differently than other filesystems.  It also ignores the generic
>> *atime mount options because it cannot support the atime semantics
>> of local filesystems.
>> 
>> We should document that somewhere.  nfs(5) seems like a logical
>> place for it.
>> 
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> I'm a bit confused... What is the different between this patch
> and the one you posted back in Nov 18
>   http://www.spinics.net/lists/linux-nfs/msg40559.html
> which turned to commit
> 
>  commit f41c591f8f4d492ee84994bb86810fb90bef8d4b
>  Author: Chuck Lever <chuck.lever@oracle.com>
>  Date:   Wed Nov 20 14:10:06 2013 -0500

I pulled, but didn’t see this one.  If you already have it post 1.2.9, you can ignore this patch.


> 
> steved.
>> ---
>> utils/mount/nfs.man |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 59 insertions(+)
>> 
>> diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man
>> index 67031b5..2250963 100644
>> --- a/utils/mount/nfs.man
>> +++ b/utils/mount/nfs.man
>> @@ -1227,6 +1227,65 @@ If absolute cache coherence among clients is required,
>> applications should use file locking. Alternatively, applications
>> can also open their files with the O_DIRECT flag
>> to disable data caching entirely.
>> +.SS "File timestamp maintainence"
>> +NFS servers are responsible for managing file and directory timestamps
>> +.RB ( atime ,
>> +.BR ctime ", and"
>> +.BR mtime ).
>> +When a file is accessed or updated on an NFS server,
>> +the file's timestamps are updated just like they would be on a filesystem
>> +local to an application.
>> +.P
>> +NFS clients cache file attributes, including timestamps.
>> +A file's timestamps are updated on NFS clients when its attributes
>> +are retrieved from the NFS server.
>> +Thus there may be some delay before timestamp updates
>> +on an NFS server appear to applications on NFS clients.
>> +.P
>> +To comply with the POSIX filesystem standard, the Linux NFS client
>> +relies on NFS servers to keep a file's
>> +.B mtime
>> +and
>> +.B ctime
>> +timestamps properly up to date.
>> +It does this by flushing local data changes to the server
>> +before reporting
>> +.B mtime
>> +to applications via system calls such as
>> +.BR stat (2).
>> +.P
>> +The Linux client handles
>> +.B atime
>> +updates more loosely, however.
>> +NFS clients maintain good performance by caching data,
>> +but that means that application reads, which normally update
>> +.BR atime ,
>> +are not reflected to the server where a file's
>> +.B atime
>> +is actually maintained.
>> +.P
>> +Because of this caching behavior,
>> +the Linux NFS client does not support generic atime-related mount options.
>> +See
>> +.BR mount (8)
>> +for details on these options.
>> +.P
>> +In particular, the
>> +.BR atime / noatime ,
>> +.BR diratime / nodiratime ,
>> +.BR relatime / norelatime ,
>> +and
>> +.BR strictatime / nostrictatime
>> +mount options have no effect on NFS mounts.
>> +.P
>> +.I /proc/mounts
>> +may report that the
>> +.B relatime
>> +mount option is set on NFS mounts, but in fact the
>> +.B atime
>> +semantics are always as described here, and are not like
>> +.B relatime
>> +semantics.
>> .SS "Directory entry caching"
>> The Linux NFS client caches the result of all NFS LOOKUP requests.
>> If the requested directory entry exists on the server,
>> 

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-18 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 17:31 [PATCH v2] nfs(5): Treatment of *atime mount options Chuck Lever
2014-01-18 16:00 ` Steve Dickson
2014-01-18 16:25   ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox