Skip to content

Commit

Permalink
[PATCH] nfsd: nfs_replay_me
Browse files Browse the repository at this point in the history
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: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Oct 20, 2006
1 parent c7afef1 commit a90b061
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
status = nfsd4_process_open1(open);
if (status == NFSERR_REPLAY_ME) {
if (status == nfserr_replay_me) {
struct nfs4_replay *rp = &open->op_stateowner->so_replay;
fh_put(current_fh);
current_fh->fh_handle.fh_size = rp->rp_openfh_len;
Expand All @@ -188,7 +188,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
dprintk("nfsd4_open: replay failed"
" restoring previous filehandle\n");
else
status = NFSERR_REPLAY_ME;
status = nfserr_replay_me;
}
if (status)
goto out;
Expand Down Expand Up @@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
}

encode_op:
if (op->status == NFSERR_REPLAY_ME) {
if (op->status == nfserr_replay_me) {
op->replay = &replay_owner->so_replay;
nfsd4_encode_replay(resp, op);
status = op->status = op->replay->rp_status;
Expand Down
4 changes: 2 additions & 2 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ nfsd4_process_open1(struct nfsd4_open *open)
}
if (open->op_seqid == sop->so_seqid - 1) {
if (sop->so_replay.rp_buflen)
return NFSERR_REPLAY_ME;
return nfserr_replay_me;
/* The original OPEN failed so spectacularly
* that we don't even have replay data saved!
* Therefore, we have no choice but to continue
Expand Down Expand Up @@ -2233,7 +2233,7 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
if (seqid == sop->so_seqid - 1) {
dprintk("NFSD: preprocess_seqid_op: retransmission?\n");
/* 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",
sop->so_seqid, seqid);
Expand Down
1 change: 1 addition & 0 deletions include/linux/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void);
#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
#define nfserr_locked __constant_htonl(NFSERR_LOCKED)
#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)

/* error codes for internal use */
/* if a request fails due to kmalloc failure, it gets dropped.
Expand Down

0 comments on commit a90b061

Please sign in to comment.