diff options
-rw-r--r-- | fs/lockd/clntproc.c | 2 | ||||
-rw-r--r-- | fs/lockd/mon.c | 18 | ||||
-rw-r--r-- | include/linux/lockd/lockd.h | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 273e229353f3..f2fdcbce143e 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -126,7 +126,6 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) | |||
126 | struct nlm_lock *lock = &argp->lock; | 126 | struct nlm_lock *lock = &argp->lock; |
127 | 127 | ||
128 | nlmclnt_next_cookie(&argp->cookie); | 128 | nlmclnt_next_cookie(&argp->cookie); |
129 | argp->state = nsm_local_state; | ||
130 | memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh)); | 129 | memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh)); |
131 | lock->caller = utsname()->nodename; | 130 | lock->caller = utsname()->nodename; |
132 | lock->oh.data = req->a_owner; | 131 | lock->oh.data = req->a_owner; |
@@ -521,6 +520,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl) | |||
521 | 520 | ||
522 | if (nsm_monitor(host) < 0) | 521 | if (nsm_monitor(host) < 0) |
523 | goto out; | 522 | goto out; |
523 | req->a_args.state = nsm_local_state; | ||
524 | 524 | ||
525 | fl->fl_flags |= FL_ACCESS; | 525 | fl->fl_flags |= FL_ACCESS; |
526 | status = do_vfs_lock(fl); | 526 | status = do_vfs_lock(fl); |
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 6d5d4a4169e5..38385336614c 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -53,7 +53,7 @@ static DEFINE_SPINLOCK(nsm_lock); | |||
53 | /* | 53 | /* |
54 | * Local NSM state | 54 | * Local NSM state |
55 | */ | 55 | */ |
56 | int __read_mostly nsm_local_state; | 56 | u32 __read_mostly nsm_local_state; |
57 | int __read_mostly nsm_use_hostnames; | 57 | int __read_mostly nsm_use_hostnames; |
58 | 58 | ||
59 | static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm) | 59 | static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm) |
@@ -184,13 +184,19 @@ int nsm_monitor(const struct nlm_host *host) | |||
184 | nsm->sm_mon_name = nsm_use_hostnames ? nsm->sm_name : nsm->sm_addrbuf; | 184 | nsm->sm_mon_name = nsm_use_hostnames ? nsm->sm_name : nsm->sm_addrbuf; |
185 | 185 | ||
186 | status = nsm_mon_unmon(nsm, NSMPROC_MON, &res); | 186 | status = nsm_mon_unmon(nsm, NSMPROC_MON, &res); |
187 | if (res.status != 0) | 187 | if (unlikely(res.status != 0)) |
188 | status = -EIO; | 188 | status = -EIO; |
189 | if (status < 0) | 189 | if (unlikely(status < 0)) { |
190 | printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name); | 190 | printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name); |
191 | else | 191 | return status; |
192 | nsm->sm_monitored = 1; | 192 | } |
193 | return status; | 193 | |
194 | nsm->sm_monitored = 1; | ||
195 | if (unlikely(nsm_local_state != res.state)) { | ||
196 | nsm_local_state = res.state; | ||
197 | dprintk("lockd: NSM state changed to %d\n", nsm_local_state); | ||
198 | } | ||
199 | return 0; | ||
194 | } | 200 | } |
195 | 201 | ||
196 | /** | 202 | /** |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 51855dfd8adb..c325b187966b 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
195 | extern int nlmsvc_grace_period; | 195 | extern int nlmsvc_grace_period; |
196 | extern unsigned long nlmsvc_timeout; | 196 | extern unsigned long nlmsvc_timeout; |
197 | extern int nsm_use_hostnames; | 197 | extern int nsm_use_hostnames; |
198 | extern int nsm_local_state; | 198 | extern u32 nsm_local_state; |
199 | 199 | ||
200 | /* | 200 | /* |
201 | * Lockd client functions | 201 | * Lockd client functions |