Commit bfc505de authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

pNFS: Fix atime updates on pNFS clients

Fix the code so that we always mark the atime as invalid in nfs4_read_done().
Currently, the expectation appears to be that the pNFS drivers should always
do this, with the result that most of them don't.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 77b00bc0
...@@ -560,7 +560,6 @@ void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo, ...@@ -560,7 +560,6 @@ void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq);
/* nfs4proc.c */ /* nfs4proc.c */
extern void __nfs4_read_done_cb(struct nfs_pgio_header *);
extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, extern struct nfs_client *nfs4_init_client(struct nfs_client *clp,
const struct nfs_client_initdata *); const struct nfs_client_initdata *);
extern int nfs40_walk_client_list(struct nfs_client *clp, extern int nfs40_walk_client_list(struct nfs_client *clp,
......
...@@ -4557,11 +4557,6 @@ static bool nfs4_error_stateid_expired(int err) ...@@ -4557,11 +4557,6 @@ static bool nfs4_error_stateid_expired(int err)
return false; return false;
} }
void __nfs4_read_done_cb(struct nfs_pgio_header *hdr)
{
nfs_invalidate_atime(hdr->inode);
}
static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_header *hdr) static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_header *hdr)
{ {
struct nfs_server *server = NFS_SERVER(hdr->inode); struct nfs_server *server = NFS_SERVER(hdr->inode);
...@@ -4581,7 +4576,6 @@ static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_header *hdr) ...@@ -4581,7 +4576,6 @@ static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_header *hdr)
} }
} }
__nfs4_read_done_cb(hdr);
if (task->tk_status > 0) if (task->tk_status > 0)
renew_lease(server, hdr->timestamp); renew_lease(server, hdr->timestamp);
return 0; return 0;
...@@ -4610,6 +4604,8 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr) ...@@ -4610,6 +4604,8 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
return -EAGAIN; return -EAGAIN;
if (nfs4_read_stateid_changed(task, &hdr->args)) if (nfs4_read_stateid_changed(task, &hdr->args))
return -EAGAIN; return -EAGAIN;
if (task->tk_status > 0)
nfs_invalidate_atime(hdr->inode);
return hdr->pgio_done_cb ? hdr->pgio_done_cb(task, hdr) : return hdr->pgio_done_cb ? hdr->pgio_done_cb(task, hdr) :
nfs4_read_done_cb(task, hdr); nfs4_read_done_cb(task, hdr);
} }
......
...@@ -2230,10 +2230,8 @@ static void pnfs_ld_handle_read_error(struct nfs_pgio_header *hdr) ...@@ -2230,10 +2230,8 @@ static void pnfs_ld_handle_read_error(struct nfs_pgio_header *hdr)
*/ */
void pnfs_ld_read_done(struct nfs_pgio_header *hdr) void pnfs_ld_read_done(struct nfs_pgio_header *hdr)
{ {
if (likely(!hdr->pnfs_error)) { if (likely(!hdr->pnfs_error))
__nfs4_read_done_cb(hdr);
hdr->mds_ops->rpc_call_done(&hdr->task, hdr); hdr->mds_ops->rpc_call_done(&hdr->task, hdr);
}
trace_nfs4_pnfs_read(hdr, hdr->pnfs_error); trace_nfs4_pnfs_read(hdr, hdr->pnfs_error);
if (unlikely(hdr->pnfs_error)) if (unlikely(hdr->pnfs_error))
pnfs_ld_handle_read_error(hdr); pnfs_ld_handle_read_error(hdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment