diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-20 02:29:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:43 -0400 |
commit | a90b061c0bf712961cea40d9c916b300073d12e5 (patch) | |
tree | 74514dbfc0e7814b983ad98bef55086539248d0a | |
parent | c7afef1f963bec198b186cc34b9e8c9b9ce2e266 (diff) |
[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: 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>
-rw-r--r-- | fs/nfsd/nfs4proc.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | include/linux/nfsd/nfsd.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 63823945f972..0a7bbdc4a10a 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -177,7 +177,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open | |||
177 | 177 | ||
178 | /* check seqid for replay. set nfs4_owner */ | 178 | /* check seqid for replay. set nfs4_owner */ |
179 | status = nfsd4_process_open1(open); | 179 | status = nfsd4_process_open1(open); |
180 | if (status == NFSERR_REPLAY_ME) { | 180 | if (status == nfserr_replay_me) { |
181 | struct nfs4_replay *rp = &open->op_stateowner->so_replay; | 181 | struct nfs4_replay *rp = &open->op_stateowner->so_replay; |
182 | fh_put(current_fh); | 182 | fh_put(current_fh); |
183 | current_fh->fh_handle.fh_size = rp->rp_openfh_len; | 183 | 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 | dprintk("nfsd4_open: replay failed" | 188 | dprintk("nfsd4_open: replay failed" |
189 | " restoring previous filehandle\n"); | 189 | " restoring previous filehandle\n"); |
190 | else | 190 | else |
191 | status = NFSERR_REPLAY_ME; | 191 | status = nfserr_replay_me; |
192 | } | 192 | } |
193 | if (status) | 193 | if (status) |
194 | goto out; | 194 | goto out; |
@@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
937 | } | 937 | } |
938 | 938 | ||
939 | encode_op: | 939 | encode_op: |
940 | if (op->status == NFSERR_REPLAY_ME) { | 940 | if (op->status == nfserr_replay_me) { |
941 | op->replay = &replay_owner->so_replay; | 941 | op->replay = &replay_owner->so_replay; |
942 | nfsd4_encode_replay(resp, op); | 942 | nfsd4_encode_replay(resp, op); |
943 | status = op->status = op->replay->rp_status; | 943 | status = op->status = op->replay->rp_status; |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 2e468c9e64d9..293b6495829f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1477,7 +1477,7 @@ nfsd4_process_open1(struct nfsd4_open *open) | |||
1477 | } | 1477 | } |
1478 | if (open->op_seqid == sop->so_seqid - 1) { | 1478 | if (open->op_seqid == sop->so_seqid - 1) { |
1479 | if (sop->so_replay.rp_buflen) | 1479 | if (sop->so_replay.rp_buflen) |
1480 | return NFSERR_REPLAY_ME; | 1480 | return nfserr_replay_me; |
1481 | /* The original OPEN failed so spectacularly | 1481 | /* The original OPEN failed so spectacularly |
1482 | * that we don't even have replay data saved! | 1482 | * that we don't even have replay data saved! |
1483 | * Therefore, we have no choice but to continue | 1483 | * Therefore, we have no choice but to continue |
@@ -2233,7 +2233,7 @@ check_replay: | |||
2233 | if (seqid == sop->so_seqid - 1) { | 2233 | if (seqid == sop->so_seqid - 1) { |
2234 | dprintk("NFSD: preprocess_seqid_op: retransmission?\n"); | 2234 | dprintk("NFSD: preprocess_seqid_op: retransmission?\n"); |
2235 | /* indicate replay to calling function */ | 2235 | /* indicate replay to calling function */ |
2236 | return NFSERR_REPLAY_ME; | 2236 | return nfserr_replay_me; |
2237 | } | 2237 | } |
2238 | printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n", | 2238 | printk("NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)\n", |
2239 | sop->so_seqid, seqid); | 2239 | sop->so_seqid, seqid); |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 68d29b66c6e2..eb231143d579 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void); | |||
238 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) | 238 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) |
239 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) | 239 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) |
240 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) | 240 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) |
241 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) | ||
241 | 242 | ||
242 | /* error codes for internal use */ | 243 | /* error codes for internal use */ |
243 | /* if a request fails due to kmalloc failure, it gets dropped. | 244 | /* if a request fails due to kmalloc failure, it gets dropped. |