aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/xdr.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 12:18:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 12:18:27 -0500
commit53846a21c1766326bb14ce8ab6e997a0c120675d (patch)
tree37b04485e29844b4e734479181276a2f4d2447e4 /fs/lockd/xdr.c
parent2e9abdd9bad485970b37cd53a82f92702054984c (diff)
parent1ebbe2b20091d306453a5cf480a87e6cd28ae76f (diff)
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (103 commits) SUNRPC,RPCSEC_GSS: spkm3--fix config dependencies SUNRPC,RPCSEC_GSS: spkm3: import contexts using NID_cast5_cbc LOCKD: Make nlmsvc_traverse_shares return void LOCKD: nlmsvc_traverse_blocks return is unused SUNRPC,RPCSEC_GSS: fix krb5 sequence numbers. NFSv4: Dont list system.nfs4_acl for filesystems that don't support it. SUNRPC,RPCSEC_GSS: remove unnecessary kmalloc of a checksum SUNRPC: Ensure rpc_call_async() always calls tk_ops->rpc_release() SUNRPC: Fix memory barriers for req->rq_received NFS: Fix a race in nfs_sync_inode() NFS: Clean up nfs_flush_list() NFS: Fix a race with PG_private and nfs_release_page() NFSv4: Ensure the callback daemon flushes signals SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs NFS, NLM: Allow blocking locks to respect signals NFS: Make nfs_fhget() return appropriate error values NFSv4: Fix an oops in nfs4_fill_super lockd: blocks should hold a reference to the nlm_file NFSv4: SETCLIENTID_CONFIRM should handle NFS4ERR_DELAY/NFS4ERR_RESOURCE NFSv4: Send the delegation stateid for SETATTR calls ...
Diffstat (limited to 'fs/lockd/xdr.c')
-rw-r--r--fs/lockd/xdr.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 1d700a4dd0b5..f22a3764461a 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -131,10 +131,11 @@ nlm_decode_lock(u32 *p, struct nlm_lock *lock)
131 || !(p = nlm_decode_fh(p, &lock->fh)) 131 || !(p = nlm_decode_fh(p, &lock->fh))
132 || !(p = nlm_decode_oh(p, &lock->oh))) 132 || !(p = nlm_decode_oh(p, &lock->oh)))
133 return NULL; 133 return NULL;
134 lock->svid = ntohl(*p++);
134 135
135 locks_init_lock(fl); 136 locks_init_lock(fl);
136 fl->fl_owner = current->files; 137 fl->fl_owner = current->files;
137 fl->fl_pid = ntohl(*p++); 138 fl->fl_pid = (pid_t)lock->svid;
138 fl->fl_flags = FL_POSIX; 139 fl->fl_flags = FL_POSIX;
139 fl->fl_type = F_RDLCK; /* as good as anything else */ 140 fl->fl_type = F_RDLCK; /* as good as anything else */
140 start = ntohl(*p++); 141 start = ntohl(*p++);
@@ -174,7 +175,7 @@ nlm_encode_lock(u32 *p, struct nlm_lock *lock)
174 else 175 else
175 len = loff_t_to_s32(fl->fl_end - fl->fl_start + 1); 176 len = loff_t_to_s32(fl->fl_end - fl->fl_start + 1);
176 177
177 *p++ = htonl(fl->fl_pid); 178 *p++ = htonl(lock->svid);
178 *p++ = htonl(start); 179 *p++ = htonl(start);
179 *p++ = htonl(len); 180 *p++ = htonl(len);
180 181
@@ -197,7 +198,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
197 struct file_lock *fl = &resp->lock.fl; 198 struct file_lock *fl = &resp->lock.fl;
198 199
199 *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one; 200 *p++ = (fl->fl_type == F_RDLCK)? xdr_zero : xdr_one;
200 *p++ = htonl(fl->fl_pid); 201 *p++ = htonl(resp->lock.svid);
201 202
202 /* Encode owner handle. */ 203 /* Encode owner handle. */
203 if (!(p = xdr_encode_netobj(p, &resp->lock.oh))) 204 if (!(p = xdr_encode_netobj(p, &resp->lock.oh)))
@@ -298,7 +299,8 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
298 299
299 memset(lock, 0, sizeof(*lock)); 300 memset(lock, 0, sizeof(*lock));
300 locks_init_lock(&lock->fl); 301 locks_init_lock(&lock->fl);
301 lock->fl.fl_pid = ~(u32) 0; 302 lock->svid = ~(u32) 0;
303 lock->fl.fl_pid = (pid_t)lock->svid;
302 304
303 if (!(p = nlm_decode_cookie(p, &argp->cookie)) 305 if (!(p = nlm_decode_cookie(p, &argp->cookie))
304 || !(p = xdr_decode_string_inplace(p, &lock->caller, 306 || !(p = xdr_decode_string_inplace(p, &lock->caller,
@@ -415,7 +417,8 @@ nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
415 memset(&resp->lock, 0, sizeof(resp->lock)); 417 memset(&resp->lock, 0, sizeof(resp->lock));
416 locks_init_lock(fl); 418 locks_init_lock(fl);
417 excl = ntohl(*p++); 419 excl = ntohl(*p++);
418 fl->fl_pid = ntohl(*p++); 420 resp->lock.svid = ntohl(*p++);
421 fl->fl_pid = (pid_t)resp->lock.svid;
419 if (!(p = nlm_decode_oh(p, &resp->lock.oh))) 422 if (!(p = nlm_decode_oh(p, &resp->lock.oh)))
420 return -EIO; 423 return -EIO;
421 424
@@ -543,7 +546,9 @@ nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
543 .p_proc = NLMPROC_##proc, \ 546 .p_proc = NLMPROC_##proc, \
544 .p_encode = (kxdrproc_t) nlmclt_encode_##argtype, \ 547 .p_encode = (kxdrproc_t) nlmclt_encode_##argtype, \
545 .p_decode = (kxdrproc_t) nlmclt_decode_##restype, \ 548 .p_decode = (kxdrproc_t) nlmclt_decode_##restype, \
546 .p_bufsiz = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2 \ 549 .p_bufsiz = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2, \
550 .p_statidx = NLMPROC_##proc, \
551 .p_name = #proc, \
547 } 552 }
548 553
549static struct rpc_procinfo nlm_procedures[] = { 554static struct rpc_procinfo nlm_procedures[] = {