From owner-svn-src-all@FreeBSD.ORG Thu May 21 01:50:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E96F106566B; Thu, 21 May 2009 01:50:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9978FC1B; Thu, 21 May 2009 01:50:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4L1oRN7050643; Thu, 21 May 2009 01:50:28 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4L1oRgd050642; Thu, 21 May 2009 01:50:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905210150.n4L1oRgd050642@svn.freebsd.org> From: Rick Macklem Date: Thu, 21 May 2009 01:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192503 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 01:50:28 -0000 Author: rmacklem Date: Thu May 21 01:50:27 2009 New Revision: 192503 URL: http://svn.freebsd.org/changeset/base/192503 Log: Modify sys/fs/nfsserver/nfs_nfsdport.c to use nlm_acquire_next_sysid() to set the l_sysid for locks correctly. Approved by: kib (mentor) Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:48:42 2009 (r192502) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:50:27 2009 (r192503) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern int nfsv4root_set; @@ -56,6 +58,7 @@ struct mtx nfs_cache_mutex; struct mtx nfs_v4root_mutex; struct nfsrvfh nfs_rootfh, nfs_pubfh; int nfs_pubfhset = 0, nfs_rootfhset = 0; +static uint32_t nfsv4_sysid = 0; static int nfssvc_srvcall(struct thread *, struct nfssvc_args *, struct ucred *); @@ -2777,8 +2780,10 @@ nfsvno_localconflict(struct vnode *vp, i * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024 * bytes, so it can't be put in l_sysid. */ + if (nfsv4_sysid == 0) + nfsv4_sysid = nlm_acquire_next_sysid(); fl.l_pid = (pid_t)0; - fl.l_sysid = 0; + fl.l_sysid = (int)nfsv4_sysid; NFSVOPUNLOCK(vp, 0, td); error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl, @@ -2837,8 +2842,10 @@ nfsvno_advlock(struct vnode *vp, int fty * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024 * bytes, so it can't be put in l_sysid. */ + if (nfsv4_sysid == 0) + nfsv4_sysid = nlm_acquire_next_sysid(); fl.l_pid = (pid_t)0; - fl.l_sysid = 0; + fl.l_sysid = (int)nfsv4_sysid; NFSVOPUNLOCK(vp, 0, td); error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,