Commit a90b061c authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] nfsd: nfs_replay_me

We are using NFS_REPLAY_ME as a special error value that is never leaked to
clients.  That works fine; the only problem is mixing host- and network-
endian values in the same objects.  Network-endian equivalent would work just
as fine; switch to it.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c7afef1f
...@@ -177,7 +177,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open ...@@ -177,7 +177,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
/* check seqid for replay. set nfs4_owner */ /* check seqid for replay. set nfs4_owner */
status = nfsd4_process_open1(open); status = nfsd4_process_open1(open);
if (status == NFSERR_REPLAY_ME) { if (status == nfserr_replay_me) {
struct nfs4_replay *rp = &open->op_stateowner->so_replay; struct nfs4_replay *rp = &open->op_stateowner->so_replay;
fh_put(current_fh); fh_put(current_fh);
current_fh->fh_handle.fh_size = rp->rp_openfh_len; current_fh->fh_handle.fh_size = rp->rp_openfh_len;
...@@ -188,7 +188,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open ...@@ -188,7 +188,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
dprintk("nfsd4_open: replay failed" dprintk("nfsd4_open: replay failed"
" restoring previous filehandle\n"); " restoring previous filehandle\n");
else else
status = NFSERR_REPLAY_ME; status = nfserr_replay_me;
} }
if (status) if (status)
goto out; goto out;
...@@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, ...@@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
} }
encode_op: encode_op:
if (op->status == NFSERR_REPLAY_ME) { if (op->status == nfserr_replay_me) {
op->replay = &replay_owner->so_replay; op->replay = &replay_owner->so_replay;
nfsd4_encode_replay(resp, op); nfsd4_encode_replay(resp, op);
status = op->status = op->replay->rp_status; status = op->status = op->replay->rp_status;
......
...@@ -1477,7 +1477,7 @@ nfsd4_process_open1(struct nfsd4_open *open) ...@@ -1477,7 +1477,7 @@ nfsd4_process_open1(struct nfsd4_open *open)
} }
if (open->op_seqid == sop->so_seqid - 1) { if (open->op_seqid == sop->so_seqid - 1) {
if (sop->so_replay.rp_buflen) if (sop->so_replay.rp_buflen)
return NFSERR_REPLAY_ME; return nfserr_replay_me;
/* The original OPEN failed so spectacularly /* The original OPEN failed so spectacularly
* that we don't even have replay data saved! * that we don't even have replay data saved!
* Therefore, we have no choice but to continue * Therefore, we have no choice but to continue
...@@ -2233,7 +2233,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei ...@@ -2233,7 +2233,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
if (seqid == sop->so_seqid - 1) { if (seqid == sop->so_seqid - 1) {
dprintk("NFSD: preprocess_seqid_op: retransmission?\n"); dprintk("NFSD: preprocess_seqid_op: retransmission?\n");
/* indicate replay to calling function */ /* indicate replay to calling function */
return NFSERR_REPLAY_ME; return nfserr_replay_me;
} }
printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n", printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n",
sop->so_seqid, seqid); sop->so_seqid, seqid);
......
...@@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void); ...@@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void);
#define nfserr_badname __constant_htonl(NFSERR_BADNAME) #define nfserr_badname __constant_htonl(NFSERR_BADNAME)
#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
#define nfserr_locked __constant_htonl(NFSERR_LOCKED) #define nfserr_locked __constant_htonl(NFSERR_LOCKED)
#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)
/* error codes for internal use */ /* error codes for internal use */
/* if a request fails due to kmalloc failure, it gets dropped. /* if a request fails due to kmalloc failure, it gets dropped.
......
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