]> err.no Git - linux-2.6/commitdiff
NFS: Fix atime revalidation in read()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Sep 2007 21:20:07 +0000 (17:20 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:19:06 +0000 (17:19 -0400)
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>
fs/nfs/nfs3proc.c
fs/nfs/nfs4proc.c
fs/nfs/proc.c
fs/nfs/read.c

index 0ae263cdedc6912ba671e0b26fb7ea000bf9ac87..fc6b1193a6311a32a6889daa95dd11e7d618af26 100644 (file)
@@ -727,9 +727,9 @@ static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data)
 {
        if (nfs3_async_handle_jukebox(task, data->inode))
                return -EAGAIN;
-       /* Call back common NFS readpage processing */
-       if (task->tk_status >= 0)
-               nfs_refresh_inode(data->inode, &data->fattr);
+
+       nfs_invalidate_atime(data->inode);
+       nfs_refresh_inode(data->inode, &data->fattr);
        return 0;
 }
 
index 9c27a6ed1a62a8f061825379d8f4d9689e8973d0..d311984d2c8890c46e603b1ff1c6ebe621eba6d3 100644 (file)
@@ -2396,6 +2396,8 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
                rpc_restart_call(task);
                return -EAGAIN;
        }
+
+       nfs_invalidate_atime(data->inode);
        if (task->tk_status > 0)
                renew_lease(server, data->timestamp);
        return 0;
index cfc4130f2aece472a2fa79e11f3b8014f1a518dc..ec3ede890bf4af3d0473e32ce18cf43b13717831 100644 (file)
@@ -552,6 +552,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
 
 static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
 {
+       nfs_invalidate_atime(data->inode);
        if (task->tk_status >= 0) {
                nfs_refresh_inode(data->inode, data->res.fattr);
                /* Emulate the eof flag, which isn't normally needed in NFSv2
index d6e62d7afc72a15028ec2c9ea2f94de07336aa66..4587a86adaac8d5cc0762f36fbddaa3b96dc71f8 100644 (file)
@@ -341,9 +341,6 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data)
                set_bit(NFS_INO_STALE, &NFS_FLAGS(data->inode));
                nfs_mark_for_revalidate(data->inode);
        }
-       spin_lock(&data->inode->i_lock);
-       NFS_I(data->inode)->cache_validity |= NFS_INO_INVALID_ATIME;
-       spin_unlock(&data->inode->i_lock);
        return 0;
 }