aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-09-28 17:20:07 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:19:06 -0400
commit8850df999cd16aa141098e2e8be04a590276f3cc (patch)
treede5d934bff3ae6595dcfcf6d725dd991bb242f21 /fs
parentc4812998398d9cbce8646494704c52297359ede0 (diff)
NFS: Fix atime revalidation in read()
NFSv3 will correctly update atime on a read() call, so there is no need to set the NFS_INO_INVALID_ATIME flag unless the call to nfs_refresh_inode() fails. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs3proc.c6
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/proc.c1
-rw-r--r--fs/nfs/read.c3
4 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 0ae263cdedc6..fc6b1193a631 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -727,9 +727,9 @@ static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data)
727{ 727{
728 if (nfs3_async_handle_jukebox(task, data->inode)) 728 if (nfs3_async_handle_jukebox(task, data->inode))
729 return -EAGAIN; 729 return -EAGAIN;
730 /* Call back common NFS readpage processing */ 730
731 if (task->tk_status >= 0) 731 nfs_invalidate_atime(data->inode);
732 nfs_refresh_inode(data->inode, &data->fattr); 732 nfs_refresh_inode(data->inode, &data->fattr);
733 return 0; 733 return 0;
734} 734}
735 735
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 9c27a6ed1a62..d311984d2c88 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2396,6 +2396,8 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
2396 rpc_restart_call(task); 2396 rpc_restart_call(task);
2397 return -EAGAIN; 2397 return -EAGAIN;
2398 } 2398 }
2399
2400 nfs_invalidate_atime(data->inode);
2399 if (task->tk_status > 0) 2401 if (task->tk_status > 0)
2400 renew_lease(server, data->timestamp); 2402 renew_lease(server, data->timestamp);
2401 return 0; 2403 return 0;
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index cfc4130f2aec..ec3ede890bf4 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -552,6 +552,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
552 552
553static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data) 553static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
554{ 554{
555 nfs_invalidate_atime(data->inode);
555 if (task->tk_status >= 0) { 556 if (task->tk_status >= 0) {
556 nfs_refresh_inode(data->inode, data->res.fattr); 557 nfs_refresh_inode(data->inode, data->res.fattr);
557 /* Emulate the eof flag, which isn't normally needed in NFSv2 558 /* Emulate the eof flag, which isn't normally needed in NFSv2
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index d6e62d7afc72..4587a86adaac 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -341,9 +341,6 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data)
341 set_bit(NFS_INO_STALE, &NFS_FLAGS(data->inode)); 341 set_bit(NFS_INO_STALE, &NFS_FLAGS(data->inode));
342 nfs_mark_for_revalidate(data->inode); 342 nfs_mark_for_revalidate(data->inode);
343 } 343 }
344 spin_lock(&data->inode->i_lock);
345 NFS_I(data->inode)->cache_validity |= NFS_INO_INVALID_ATIME;
346 spin_unlock(&data->inode->i_lock);
347 return 0; 344 return 0;
348} 345}
349 346