NFS: Optimise attribute revalidation on close(). Only force a getattr in nfs_file_flush() if the attribute cache is stale. Signed-off-by: Trond Myklebust --- fs/nfs/file.c | 4 ++-- 4 files changed, 35 insertions(+), 9 deletions(-) Index: linux-2.6/fs/nfs/file.c =================================================================== --- linux-2.6.orig/fs/nfs/file.c +++ linux-2.6/fs/nfs/file.c @@ -205,8 +205,8 @@ nfs_file_flush(struct file *file) if (!status) { status = ctx->error; ctx->error = 0; - if (!status && !nfs_have_delegation(inode, FMODE_READ)) - __nfs_revalidate_inode(NFS_SERVER(inode), inode); + if (!status) + nfs_revalidate_inode(NFS_SERVER(inode), inode); } unlock_kernel(); return status;