Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153628
b: refs/heads/master
c: 6c9dc42
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jun 18, 2009
1 parent d62535e commit c7514c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18fc31641925867c871bc75270ce642c039188d3
refs/heads/master: 6c9dc4255108bab4ef5c177d369b99c3c23492a7
2 changes: 1 addition & 1 deletion trunk/fs/lockd/clntproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
struct nlm_lock *lock = &argp->lock;

nlmclnt_next_cookie(&argp->cookie);
argp->state = nsm_local_state;
memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh));
lock->caller = utsname()->nodename;
lock->oh.data = req->a_owner;
Expand Down Expand Up @@ -521,6 +520,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)

if (nsm_monitor(host) < 0)
goto out;
req->a_args.state = nsm_local_state;

fl->fl_flags |= FL_ACCESS;
status = do_vfs_lock(fl);
Expand Down
18 changes: 12 additions & 6 deletions trunk/fs/lockd/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static DEFINE_SPINLOCK(nsm_lock);
/*
* Local NSM state
*/
int __read_mostly nsm_local_state;
u32 __read_mostly nsm_local_state;
int __read_mostly nsm_use_hostnames;

static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
Expand Down Expand Up @@ -184,13 +184,19 @@ int nsm_monitor(const struct nlm_host *host)
nsm->sm_mon_name = nsm_use_hostnames ? nsm->sm_name : nsm->sm_addrbuf;

status = nsm_mon_unmon(nsm, NSMPROC_MON, &res);
if (res.status != 0)
if (unlikely(res.status != 0))
status = -EIO;
if (status < 0)
if (unlikely(status < 0)) {
printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name);
else
nsm->sm_monitored = 1;
return status;
return status;
}

nsm->sm_monitored = 1;
if (unlikely(nsm_local_state != res.state)) {
nsm_local_state = res.state;
dprintk("lockd: NSM state changed to %d\n", nsm_local_state);
}
return 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/lockd/lockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
extern int nlmsvc_grace_period;
extern unsigned long nlmsvc_timeout;
extern int nsm_use_hostnames;
extern int nsm_local_state;
extern u32 nsm_local_state;

/*
* Lockd client functions
Expand Down

0 comments on commit c7514c6

Please sign in to comment.