Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lockd: Relocate and rename nlm_drop_reply

The nlm_drop_reply status code is internal to the kernel's lockd
implementation and must never appear on the wire. Its previous
location in xdr.h grouped it with legitimate NLM protocol status
codes, obscuring this critical distinction.

Relocate the definition to lockd.h with a comment block for internal
status codes, and rename to nlm__int__drop_reply to make its
internal-only nature explicit. This prepares for adding additional
internal status codes in subsequent patches.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+38 -22
+14 -8
fs/lockd/svc4proc.c
··· 104 104 105 105 /* Obtain client and file */ 106 106 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 107 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 107 + return resp->status == nlm__int__drop_reply ? 108 + rpc_drop_reply : rpc_success; 108 109 109 110 /* Now check for conflicting locks */ 110 111 resp->status = nlmsvc_testlock(rqstp, file, host, &argp->lock, 111 112 &resp->lock); 112 - if (resp->status == nlm_drop_reply) 113 + if (resp->status == nlm__int__drop_reply) 113 114 rc = rpc_drop_reply; 114 115 else 115 116 dprintk("lockd: TEST4 status %d\n", ntohl(resp->status)); ··· 141 140 142 141 /* Obtain client and file */ 143 142 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 144 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 143 + return resp->status == nlm__int__drop_reply ? 144 + rpc_drop_reply : rpc_success; 145 145 146 146 /* Now try to lock the file */ 147 147 resp->status = nlmsvc_lock(rqstp, file, host, &argp->lock, 148 148 argp->block, &argp->cookie, 149 149 argp->reclaim); 150 - if (resp->status == nlm_drop_reply) 150 + if (resp->status == nlm__int__drop_reply) 151 151 rc = rpc_drop_reply; 152 152 else 153 153 dprintk("lockd: LOCK status %d\n", ntohl(resp->status)); ··· 184 182 185 183 /* Obtain client and file */ 186 184 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 187 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 185 + return resp->status == nlm__int__drop_reply ? 186 + rpc_drop_reply : rpc_success; 188 187 189 188 /* Try to cancel request. */ 190 189 resp->status = nlmsvc_cancel_blocked(SVC_NET(rqstp), file, &argp->lock); ··· 225 222 226 223 /* Obtain client and file */ 227 224 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 228 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 225 + return resp->status == nlm__int__drop_reply ? 226 + rpc_drop_reply : rpc_success; 229 227 230 228 /* Now try to remove the lock */ 231 229 resp->status = nlmsvc_unlock(SVC_NET(rqstp), file, &argp->lock); ··· 373 369 374 370 /* Obtain client and file */ 375 371 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 376 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 372 + return resp->status == nlm__int__drop_reply ? 373 + rpc_drop_reply : rpc_success; 377 374 378 375 /* Now try to create the share */ 379 376 resp->status = nlmsvc_share_file(host, file, argp); ··· 409 404 410 405 /* Obtain client and file */ 411 406 if ((resp->status = nlm4svc_retrieve_args(rqstp, argp, &host, &file))) 412 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 407 + return resp->status == nlm__int__drop_reply ? 408 + rpc_drop_reply : rpc_success; 413 409 414 410 /* Now try to lock the file */ 415 411 resp->status = nlmsvc_unshare_file(host, file, argp);
+2 -2
fs/lockd/svclock.c
··· 463 463 block->b_deferred_req = 464 464 rqstp->rq_chandle.defer(block->b_cache_req); 465 465 if (block->b_deferred_req != NULL) 466 - status = nlm_drop_reply; 466 + status = nlm__int__drop_reply; 467 467 } 468 468 dprintk("lockd: nlmsvc_defer_lock_rqst block %p flags %d status %d\n", 469 469 block, block->b_flags, ntohl(status)); ··· 531 531 ret = nlm_lck_denied; 532 532 goto out; 533 533 } 534 - ret = nlm_drop_reply; 534 + ret = nlm__int__drop_reply; 535 535 goto out; 536 536 } 537 537
+15 -9
fs/lockd/svcproc.c
··· 25 25 case nlm_lck_denied_nolocks: 26 26 case nlm_lck_blocked: 27 27 case nlm_lck_denied_grace_period: 28 - case nlm_drop_reply: 28 + case nlm__int__drop_reply: 29 29 break; 30 30 case nlm4_deadlock: 31 31 status = nlm_lck_denied; ··· 122 122 123 123 /* Obtain client and file */ 124 124 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 125 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 125 + return resp->status == nlm__int__drop_reply ? 126 + rpc_drop_reply : rpc_success; 126 127 127 128 /* Now check for conflicting locks */ 128 129 resp->status = cast_status(nlmsvc_testlock(rqstp, file, host, 129 130 &argp->lock, &resp->lock)); 130 - if (resp->status == nlm_drop_reply) 131 + if (resp->status == nlm__int__drop_reply) 131 132 rc = rpc_drop_reply; 132 133 else 133 134 dprintk("lockd: TEST status %d vers %d\n", ··· 160 159 161 160 /* Obtain client and file */ 162 161 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 163 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 162 + return resp->status == nlm__int__drop_reply ? 163 + rpc_drop_reply : rpc_success; 164 164 165 165 /* Now try to lock the file */ 166 166 resp->status = cast_status(nlmsvc_lock(rqstp, file, host, &argp->lock, 167 167 argp->block, &argp->cookie, 168 168 argp->reclaim)); 169 - if (resp->status == nlm_drop_reply) 169 + if (resp->status == nlm__int__drop_reply) 170 170 rc = rpc_drop_reply; 171 171 else 172 172 dprintk("lockd: LOCK status %d\n", ntohl(resp->status)); ··· 204 202 205 203 /* Obtain client and file */ 206 204 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 207 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 205 + return resp->status == nlm__int__drop_reply ? 206 + rpc_drop_reply : rpc_success; 208 207 209 208 /* Try to cancel request. */ 210 209 resp->status = cast_status(nlmsvc_cancel_blocked(net, file, &argp->lock)); ··· 246 243 247 244 /* Obtain client and file */ 248 245 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 249 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 246 + return resp->status == nlm__int__drop_reply ? 247 + rpc_drop_reply : rpc_success; 250 248 251 249 /* Now try to remove the lock */ 252 250 resp->status = cast_status(nlmsvc_unlock(net, file, &argp->lock)); ··· 404 400 405 401 /* Obtain client and file */ 406 402 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 407 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 403 + return resp->status == nlm__int__drop_reply ? 404 + rpc_drop_reply : rpc_success; 408 405 409 406 /* Now try to create the share */ 410 407 resp->status = cast_status(nlmsvc_share_file(host, file, argp)); ··· 440 435 441 436 /* Obtain client and file */ 442 437 if ((resp->status = nlmsvc_retrieve_args(rqstp, argp, &host, &file))) 443 - return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 438 + return resp->status == nlm__int__drop_reply ? 439 + rpc_drop_reply : rpc_success; 444 440 445 441 /* Now try to unshare the file */ 446 442 resp->status = cast_status(nlmsvc_unshare_file(host, file, argp));
+1 -1
fs/nfsd/lockd.c
··· 71 71 * to callback when the delegation is returned but might 72 72 * not have a proper lock request to block on. 73 73 */ 74 - return nlm_drop_reply; 74 + return nlm__int__drop_reply; 75 75 case nfserr_stale: 76 76 return nlm_stale_fh; 77 77 default:
+6
include/linux/lockd/lockd.h
··· 39 39 #define LOCKD_DFLT_TIMEO 10 40 40 41 41 /* 42 + * Internal-use status codes, not to be placed on the wire. 43 + * Version handlers translate these to appropriate wire values. 44 + */ 45 + #define nlm__int__drop_reply cpu_to_be32(30000) 46 + 47 + /* 42 48 * Lockd host handle (used both by the client and server personality). 43 49 */ 44 50 struct nlm_host {
-2
include/linux/lockd/xdr.h
··· 33 33 #define nlm_lck_blocked cpu_to_be32(NLM_LCK_BLOCKED) 34 34 #define nlm_lck_denied_grace_period cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD) 35 35 36 - #define nlm_drop_reply cpu_to_be32(30000) 37 - 38 36 /* Lock info passed via NLM */ 39 37 struct nlm_lock { 40 38 char * caller;