diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 3e4ba9cb7f80..a77ee95b7efb 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -950,11 +950,20 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
950 | 950 | ||
951 | /* Flush out writes to the server in order to update c/mtime */ | 951 | /* Flush out writes to the server in order to update c/mtime */ |
952 | nfs_sync_inode(inode, 0, 0, FLUSH_WAIT|FLUSH_NOCOMMIT); | 952 | nfs_sync_inode(inode, 0, 0, FLUSH_WAIT|FLUSH_NOCOMMIT); |
953 | if (__IS_FLG(inode, MS_NOATIME)) | 953 | |
954 | need_atime = 0; | 954 | /* |
955 | else if (__IS_FLG(inode, MS_NODIRATIME) && S_ISDIR(inode->i_mode)) | 955 | * We may force a getattr if the user cares about atime. |
956 | * | ||
957 | * Note that we only have to check the vfsmount flags here: | ||
958 | * - NFS always sets S_NOATIME by so checking it would give a | ||
959 | * bogus result | ||
960 | * - NFS never sets MS_NOATIME or MS_NODIRATIME so there is | ||
961 | * no point in checking those. | ||
962 | */ | ||
963 | if ((mnt->mnt_flags & MNT_NOATIME) || | ||
964 | ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) | ||
956 | need_atime = 0; | 965 | need_atime = 0; |
957 | /* We may force a getattr if the user cares about atime */ | 966 | |
958 | if (need_atime) | 967 | if (need_atime) |
959 | err = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 968 | err = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
960 | else | 969 | else |