1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/fs/lockd/clntproc.c
5 * RPC procedures for the client side NLM implementation
7 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
10 #include <linux/module.h>
11 #include <linux/slab.h>
12 #include <linux/types.h>
13 #include <linux/errno.h>
15 #include <linux/filelock.h>
16 #include <linux/nfs_fs.h>
17 #include <linux/utsname.h>
18 #include <linux/freezer.h>
19 #include <linux/sunrpc/clnt.h>
20 #include <linux/sunrpc/svc.h>
21 #include <linux/lockd/lockd.h>
23 #define NLMDBG_FACILITY NLMDBG_CLIENT
24 #define NLMCLNT_GRACE_WAIT (5*HZ)
25 #define NLMCLNT_POLL_TIMEOUT (30*HZ)
26 #define NLMCLNT_MAX_RETRIES 3
28 static int nlmclnt_test(struct nlm_rqst *, struct file_lock *);
29 static int nlmclnt_lock(struct nlm_rqst *, struct file_lock *);
30 static int nlmclnt_unlock(struct nlm_rqst *, struct file_lock *);
31 static int nlm_stat_to_errno(__be32 stat);
32 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host);
33 static int nlmclnt_cancel(struct nlm_host *, int , struct file_lock *);
35 static const struct rpc_call_ops nlmclnt_unlock_ops;
36 static const struct rpc_call_ops nlmclnt_cancel_ops;
39 * Cookie counter for NLM requests
41 static atomic_t nlm_cookie = ATOMIC_INIT(0x1234);
43 void nlmclnt_next_cookie(struct nlm_cookie *c)
45 u32 cookie = atomic_inc_return(&nlm_cookie);
47 memcpy(c->data, &cookie, 4);
51 static struct nlm_lockowner *
52 nlmclnt_get_lockowner(struct nlm_lockowner *lockowner)
54 refcount_inc(&lockowner->count);
58 static void nlmclnt_put_lockowner(struct nlm_lockowner *lockowner)
60 if (!refcount_dec_and_lock(&lockowner->count, &lockowner->host->h_lock))
62 list_del(&lockowner->list);
63 spin_unlock(&lockowner->host->h_lock);
64 nlmclnt_release_host(lockowner->host);
68 static inline int nlm_pidbusy(struct nlm_host *host, uint32_t pid)
70 struct nlm_lockowner *lockowner;
71 list_for_each_entry(lockowner, &host->h_lockowners, list) {
72 if (lockowner->pid == pid)
78 static inline uint32_t __nlm_alloc_pid(struct nlm_host *host)
82 res = host->h_pidcount++;
83 } while (nlm_pidbusy(host, res) < 0);
87 static struct nlm_lockowner *__nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
89 struct nlm_lockowner *lockowner;
90 list_for_each_entry(lockowner, &host->h_lockowners, list) {
91 if (lockowner->owner != owner)
93 return nlmclnt_get_lockowner(lockowner);
98 static struct nlm_lockowner *nlmclnt_find_lockowner(struct nlm_host *host, fl_owner_t owner)
100 struct nlm_lockowner *res, *new = NULL;
102 spin_lock(&host->h_lock);
103 res = __nlmclnt_find_lockowner(host, owner);
105 spin_unlock(&host->h_lock);
106 new = kmalloc(sizeof(*new), GFP_KERNEL);
107 spin_lock(&host->h_lock);
108 res = __nlmclnt_find_lockowner(host, owner);
109 if (res == NULL && new != NULL) {
111 refcount_set(&new->count, 1);
113 new->pid = __nlm_alloc_pid(host);
114 new->host = nlm_get_host(host);
115 list_add(&new->list, &host->h_lockowners);
119 spin_unlock(&host->h_lock);
125 * Initialize arguments for TEST/LOCK/UNLOCK/CANCEL calls
127 static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
129 struct nlm_args *argp = &req->a_args;
130 struct nlm_lock *lock = &argp->lock;
131 char *nodename = req->a_host->h_rpcclnt->cl_nodename;
133 nlmclnt_next_cookie(&argp->cookie);
134 memcpy(&lock->fh, NFS_FH(file_inode(fl->fl_file)), sizeof(struct nfs_fh));
135 lock->caller = nodename;
136 lock->oh.data = req->a_owner;
137 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
138 (unsigned int)fl->fl_u.nfs_fl.owner->pid,
140 lock->svid = fl->fl_u.nfs_fl.owner->pid;
141 lock->fl.fl_start = fl->fl_start;
142 lock->fl.fl_end = fl->fl_end;
143 lock->fl.fl_type = fl->fl_type;
146 static void nlmclnt_release_lockargs(struct nlm_rqst *req)
148 WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL);
152 * nlmclnt_proc - Perform a single client-side lock request
153 * @host: address of a valid nlm_host context representing the NLM server
154 * @cmd: fcntl-style file lock operation to perform
155 * @fl: address of arguments for the lock operation
156 * @data: address of data to be sent to callback operations
159 int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data)
161 struct nlm_rqst *call;
163 const struct nlmclnt_operations *nlmclnt_ops = host->h_nlmclnt_ops;
165 call = nlm_alloc_call(host);
169 if (nlmclnt_ops && nlmclnt_ops->nlmclnt_alloc_call)
170 nlmclnt_ops->nlmclnt_alloc_call(data);
172 nlmclnt_locks_init_private(fl, host);
173 if (!fl->fl_u.nfs_fl.owner) {
174 /* lockowner allocation has failed */
175 nlmclnt_release_call(call);
178 /* Set up the argument struct */
179 nlmclnt_setlockargs(call, fl);
180 call->a_callback_data = data;
182 if (IS_SETLK(cmd) || IS_SETLKW(cmd)) {
183 if (fl->fl_type != F_UNLCK) {
184 call->a_args.block = IS_SETLKW(cmd) ? 1 : 0;
185 status = nlmclnt_lock(call, fl);
187 status = nlmclnt_unlock(call, fl);
188 } else if (IS_GETLK(cmd))
189 status = nlmclnt_test(call, fl);
192 fl->fl_ops->fl_release_private(fl);
195 dprintk("lockd: clnt proc returns %d\n", status);
198 EXPORT_SYMBOL_GPL(nlmclnt_proc);
201 * Allocate an NLM RPC call struct
203 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host)
205 struct nlm_rqst *call;
208 call = kzalloc(sizeof(*call), GFP_KERNEL);
210 refcount_set(&call->a_count, 1);
211 locks_init_lock(&call->a_args.lock.fl);
212 locks_init_lock(&call->a_res.lock.fl);
213 call->a_host = nlm_get_host(host);
218 printk("nlm_alloc_call: failed, waiting for memory\n");
219 schedule_timeout_interruptible(5*HZ);
224 void nlmclnt_release_call(struct nlm_rqst *call)
226 const struct nlmclnt_operations *nlmclnt_ops = call->a_host->h_nlmclnt_ops;
228 if (!refcount_dec_and_test(&call->a_count))
230 if (nlmclnt_ops && nlmclnt_ops->nlmclnt_release_call)
231 nlmclnt_ops->nlmclnt_release_call(call->a_callback_data);
232 nlmclnt_release_host(call->a_host);
233 nlmclnt_release_lockargs(call);
237 static void nlmclnt_rpc_release(void *data)
239 nlmclnt_release_call(data);
242 static int nlm_wait_on_grace(wait_queue_head_t *queue)
247 prepare_to_wait(queue, &wait, TASK_INTERRUPTIBLE);
249 schedule_timeout(NLMCLNT_GRACE_WAIT);
254 finish_wait(queue, &wait);
262 nlmclnt_call(const struct cred *cred, struct nlm_rqst *req, u32 proc)
264 struct nlm_host *host = req->a_host;
265 struct rpc_clnt *clnt;
266 struct nlm_args *argp = &req->a_args;
267 struct nlm_res *resp = &req->a_res;
268 struct rpc_message msg = {
275 dprintk("lockd: call procedure %d on %s\n",
276 (int)proc, host->h_name);
279 if (host->h_reclaiming && !argp->reclaim)
280 goto in_grace_period;
282 /* If we have no RPC client yet, create one. */
283 if ((clnt = nlm_bind_host(host)) == NULL)
285 msg.rpc_proc = &clnt->cl_procinfo[proc];
287 /* Perform the RPC call. If an error occurs, try again */
288 if ((status = rpc_call_sync(clnt, &msg, 0)) < 0) {
289 dprintk("lockd: rpc_call returned error %d\n", -status);
291 case -EPROTONOSUPPORT:
297 nlm_rebind_host(host);
301 return signalled () ? -EINTR : status;
307 if (resp->status == nlm_lck_denied_grace_period) {
308 dprintk("lockd: server in grace period\n");
311 "lockd: spurious grace period reject?!\n");
315 if (!argp->reclaim) {
316 /* We appear to be out of the grace period */
317 wake_up_all(&host->h_gracewait);
319 dprintk("lockd: server returns status %d\n",
320 ntohl(resp->status));
321 return 0; /* Okay, call complete */
326 * The server has rebooted and appears to be in the grace
327 * period during which locks are only allowed to be
329 * We can only back off and try again later.
331 status = nlm_wait_on_grace(&host->h_gracewait);
332 } while (status == 0);
338 * Generic NLM call, async version.
340 static struct rpc_task *__nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops)
342 struct nlm_host *host = req->a_host;
343 struct rpc_clnt *clnt;
344 struct rpc_task_setup task_setup_data = {
346 .callback_ops = tk_ops,
347 .callback_data = req,
348 .flags = RPC_TASK_ASYNC,
351 dprintk("lockd: call procedure %d on %s (async)\n",
352 (int)proc, host->h_name);
354 /* If we have no RPC client yet, create one. */
355 clnt = nlm_bind_host(host);
358 msg->rpc_proc = &clnt->cl_procinfo[proc];
359 task_setup_data.rpc_client = clnt;
361 /* bootstrap and kick off the async RPC call */
362 return rpc_run_task(&task_setup_data);
364 tk_ops->rpc_release(req);
365 return ERR_PTR(-ENOLCK);
368 static int nlm_do_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops)
370 struct rpc_task *task;
372 task = __nlm_async_call(req, proc, msg, tk_ops);
374 return PTR_ERR(task);
380 * NLM asynchronous call.
382 int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
384 struct rpc_message msg = {
385 .rpc_argp = &req->a_args,
386 .rpc_resp = &req->a_res,
388 return nlm_do_async_call(req, proc, &msg, tk_ops);
391 int nlm_async_reply(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
393 struct rpc_message msg = {
394 .rpc_argp = &req->a_res,
396 return nlm_do_async_call(req, proc, &msg, tk_ops);
400 * NLM client asynchronous call.
402 * Note that although the calls are asynchronous, and are therefore
403 * guaranteed to complete, we still always attempt to wait for
404 * completion in order to be able to correctly track the lock
407 static int nlmclnt_async_call(const struct cred *cred, struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
409 struct rpc_message msg = {
410 .rpc_argp = &req->a_args,
411 .rpc_resp = &req->a_res,
414 struct rpc_task *task;
417 task = __nlm_async_call(req, proc, &msg, tk_ops);
419 return PTR_ERR(task);
420 err = rpc_wait_for_completion_task(task);
426 * TEST for the presence of a conflicting lock
429 nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
433 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_TEST);
437 switch (req->a_res.status) {
439 fl->fl_type = F_UNLCK;
443 * Report the conflicting lock back to the application.
445 fl->fl_start = req->a_res.lock.fl.fl_start;
446 fl->fl_end = req->a_res.lock.fl.fl_end;
447 fl->fl_type = req->a_res.lock.fl.fl_type;
448 fl->fl_pid = -req->a_res.lock.fl.fl_pid;
451 status = nlm_stat_to_errno(req->a_res.status);
454 nlmclnt_release_call(req);
458 static void nlmclnt_locks_copy_lock(struct file_lock *new, struct file_lock *fl)
460 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
461 new->fl_u.nfs_fl.state = fl->fl_u.nfs_fl.state;
462 new->fl_u.nfs_fl.owner = nlmclnt_get_lockowner(fl->fl_u.nfs_fl.owner);
463 list_add_tail(&new->fl_u.nfs_fl.list, &fl->fl_u.nfs_fl.owner->host->h_granted);
464 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
467 static void nlmclnt_locks_release_private(struct file_lock *fl)
469 spin_lock(&fl->fl_u.nfs_fl.owner->host->h_lock);
470 list_del(&fl->fl_u.nfs_fl.list);
471 spin_unlock(&fl->fl_u.nfs_fl.owner->host->h_lock);
472 nlmclnt_put_lockowner(fl->fl_u.nfs_fl.owner);
475 static const struct file_lock_operations nlmclnt_lock_ops = {
476 .fl_copy_lock = nlmclnt_locks_copy_lock,
477 .fl_release_private = nlmclnt_locks_release_private,
480 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host)
482 fl->fl_u.nfs_fl.state = 0;
483 fl->fl_u.nfs_fl.owner = nlmclnt_find_lockowner(host, fl->fl_owner);
484 INIT_LIST_HEAD(&fl->fl_u.nfs_fl.list);
485 fl->fl_ops = &nlmclnt_lock_ops;
488 static int do_vfs_lock(struct file_lock *fl)
490 return locks_lock_file_wait(fl->fl_file, fl);
494 * LOCK: Try to create a lock
496 * Programmer Harassment Alert
498 * When given a blocking lock request in a sync RPC call, the HPUX lockd
499 * will faithfully return LCK_BLOCKED but never cares to notify us when
500 * the lock could be granted. This way, our local process could hang
501 * around forever waiting for the callback.
503 * Solution A: Implement busy-waiting
504 * Solution B: Use the async version of the call (NLM_LOCK_{MSG,RES})
506 * For now I am implementing solution A, because I hate the idea of
507 * re-implementing lockd for a third time in two months. The async
508 * calls shouldn't be too hard to do, however.
510 * This is one of the lovely things about standards in the NFS area:
511 * they're so soft and squishy you can't really blame HP for doing this.
514 nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
516 const struct cred *cred = nfs_file_cred(fl->fl_file);
517 struct nlm_host *host = req->a_host;
518 struct nlm_res *resp = &req->a_res;
519 struct nlm_wait *block = NULL;
520 unsigned char fl_flags = fl->fl_flags;
521 unsigned char fl_type;
522 int status = -ENOLCK;
524 if (nsm_monitor(host) < 0)
526 req->a_args.state = nsm_local_state;
528 fl->fl_flags |= FL_ACCESS;
529 status = do_vfs_lock(fl);
530 fl->fl_flags = fl_flags;
534 block = nlmclnt_prepare_block(host, fl);
537 * Initialise resp->status to a valid non-zero value,
538 * since 0 == nlm_lck_granted
540 resp->status = nlm_lck_blocked;
542 /* Reboot protection */
543 fl->fl_u.nfs_fl.state = host->h_state;
544 status = nlmclnt_call(cred, req, NLMPROC_LOCK);
547 /* Did a reclaimer thread notify us of a server reboot? */
548 if (resp->status == nlm_lck_denied_grace_period)
550 if (resp->status != nlm_lck_blocked)
552 /* Wait on an NLM blocking lock */
553 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT);
556 if (resp->status != nlm_lck_blocked)
560 /* if we were interrupted while blocking, then cancel the lock request
563 if (resp->status == nlm_lck_blocked) {
564 if (!req->a_args.block)
566 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0)
570 if (resp->status == nlm_granted) {
571 down_read(&host->h_rwsem);
572 /* Check whether or not the server has rebooted */
573 if (fl->fl_u.nfs_fl.state != host->h_state) {
574 up_read(&host->h_rwsem);
577 /* Ensure the resulting lock will get added to granted list */
578 fl->fl_flags |= FL_SLEEP;
579 if (do_vfs_lock(fl) < 0)
580 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __func__);
581 up_read(&host->h_rwsem);
582 fl->fl_flags = fl_flags;
588 * EAGAIN doesn't make sense for sleeping locks, and in some
589 * cases NLM_LCK_DENIED is returned for a permanent error. So
590 * turn it into an ENOLCK.
592 if (resp->status == nlm_lck_denied && (fl_flags & FL_SLEEP))
595 status = nlm_stat_to_errno(resp->status);
597 nlmclnt_finish_block(block);
599 nlmclnt_release_call(req);
602 /* Fatal error: ensure that we remove the lock altogether */
603 dprintk("lockd: lock attempt ended in fatal error.\n"
604 " Attempting to unlock.\n");
605 nlmclnt_finish_block(block);
606 fl_type = fl->fl_type;
607 fl->fl_type = F_UNLCK;
608 down_read(&host->h_rwsem);
610 up_read(&host->h_rwsem);
611 fl->fl_type = fl_type;
612 fl->fl_flags = fl_flags;
613 nlmclnt_async_call(cred, req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops);
618 * RECLAIM: Try to reclaim a lock
621 nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl,
622 struct nlm_rqst *req)
626 memset(req, 0, sizeof(*req));
627 locks_init_lock(&req->a_args.lock.fl);
628 locks_init_lock(&req->a_res.lock.fl);
631 /* Set up the argument struct */
632 nlmclnt_setlockargs(req, fl);
633 req->a_args.reclaim = 1;
635 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_LOCK);
636 if (status >= 0 && req->a_res.status == nlm_granted)
639 printk(KERN_WARNING "lockd: failed to reclaim lock for pid %d "
640 "(errno %d, status %d)\n", fl->fl_pid,
641 status, ntohl(req->a_res.status));
644 * FIXME: This is a serious failure. We can
646 * a. Ignore the problem
647 * b. Send the owning process some signal (Linux doesn't have
648 * SIGLOST, though...)
649 * c. Retry the operation
651 * Until someone comes up with a simple implementation
652 * for b or c, I'll choose option a.
659 * UNLOCK: remove an existing lock
662 nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
664 struct nlm_host *host = req->a_host;
665 struct nlm_res *resp = &req->a_res;
667 unsigned char fl_flags = fl->fl_flags;
670 * Note: the server is supposed to either grant us the unlock
671 * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
672 * case, we want to unlock.
674 fl->fl_flags |= FL_EXISTS;
675 down_read(&host->h_rwsem);
676 status = do_vfs_lock(fl);
677 up_read(&host->h_rwsem);
678 fl->fl_flags = fl_flags;
679 if (status == -ENOENT) {
684 refcount_inc(&req->a_count);
685 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req,
686 NLMPROC_UNLOCK, &nlmclnt_unlock_ops);
690 if (resp->status == nlm_granted)
693 if (resp->status != nlm_lck_denied_nolocks)
694 printk("lockd: unexpected unlock status: %d\n",
695 ntohl(resp->status));
696 /* What to do now? I'm out of my depth... */
699 nlmclnt_release_call(req);
703 static void nlmclnt_unlock_prepare(struct rpc_task *task, void *data)
705 struct nlm_rqst *req = data;
706 const struct nlmclnt_operations *nlmclnt_ops = req->a_host->h_nlmclnt_ops;
707 bool defer_call = false;
709 if (nlmclnt_ops && nlmclnt_ops->nlmclnt_unlock_prepare)
710 defer_call = nlmclnt_ops->nlmclnt_unlock_prepare(task, req->a_callback_data);
713 rpc_call_start(task);
716 static void nlmclnt_unlock_callback(struct rpc_task *task, void *data)
718 struct nlm_rqst *req = data;
719 u32 status = ntohl(req->a_res.status);
721 if (RPC_SIGNALLED(task))
724 if (task->tk_status < 0) {
725 dprintk("lockd: unlock failed (err = %d)\n", -task->tk_status);
726 switch (task->tk_status) {
734 if (status == NLM_LCK_DENIED_GRACE_PERIOD) {
735 rpc_delay(task, NLMCLNT_GRACE_WAIT);
738 if (status != NLM_LCK_GRANTED)
739 printk(KERN_WARNING "lockd: unexpected unlock status: %d\n", status);
743 nlm_rebind_host(req->a_host);
745 rpc_restart_call(task);
748 static const struct rpc_call_ops nlmclnt_unlock_ops = {
749 .rpc_call_prepare = nlmclnt_unlock_prepare,
750 .rpc_call_done = nlmclnt_unlock_callback,
751 .rpc_release = nlmclnt_rpc_release,
755 * Cancel a blocked lock request.
756 * We always use an async RPC call for this in order not to hang a
757 * process that has been Ctrl-C'ed.
759 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl)
761 struct nlm_rqst *req;
764 dprintk("lockd: blocking lock attempt was interrupted by a signal.\n"
765 " Attempting to cancel lock.\n");
767 req = nlm_alloc_call(host);
770 req->a_flags = RPC_TASK_ASYNC;
772 nlmclnt_setlockargs(req, fl);
773 req->a_args.block = block;
775 refcount_inc(&req->a_count);
776 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req,
777 NLMPROC_CANCEL, &nlmclnt_cancel_ops);
778 if (status == 0 && req->a_res.status == nlm_lck_denied)
780 nlmclnt_release_call(req);
784 static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
786 struct nlm_rqst *req = data;
787 u32 status = ntohl(req->a_res.status);
789 if (RPC_SIGNALLED(task))
792 if (task->tk_status < 0) {
793 dprintk("lockd: CANCEL call error %d, retrying.\n",
799 case NLM_LCK_GRANTED:
800 case NLM_LCK_DENIED_GRACE_PERIOD:
802 /* Everything's good */
804 case NLM_LCK_DENIED_NOLOCKS:
805 dprintk("lockd: CANCEL failed (server has no locks)\n");
808 printk(KERN_NOTICE "lockd: weird return %d for CANCEL call\n",
816 /* Don't ever retry more than 3 times */
817 if (req->a_retries++ >= NLMCLNT_MAX_RETRIES)
819 nlm_rebind_host(req->a_host);
820 rpc_restart_call(task);
821 rpc_delay(task, 30 * HZ);
824 static const struct rpc_call_ops nlmclnt_cancel_ops = {
825 .rpc_call_done = nlmclnt_cancel_callback,
826 .rpc_release = nlmclnt_rpc_release,
830 * Convert an NLM status code to a generic kernel errno
833 nlm_stat_to_errno(__be32 status)
835 switch(ntohl(status)) {
836 case NLM_LCK_GRANTED:
840 case NLM_LCK_DENIED_NOLOCKS:
841 case NLM_LCK_DENIED_GRACE_PERIOD:
843 case NLM_LCK_BLOCKED:
844 printk(KERN_NOTICE "lockd: unexpected status NLM_BLOCKED\n");
846 #ifdef CONFIG_LOCKD_V4
859 printk(KERN_NOTICE "lockd: unexpected server status %d\n",