From owner-svn-src-stable-8@FreeBSD.ORG Mon Sep 27 02:57:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0854106564A; Mon, 27 Sep 2010 02:57:44 +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 7CEEC8FC16; Mon, 27 Sep 2010 02:57:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8R2viCq010573; Mon, 27 Sep 2010 02:57:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8R2vikN010571; Mon, 27 Sep 2010 02:57:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201009270257.o8R2vikN010571@svn.freebsd.org> From: Rick Macklem Date: Mon, 27 Sep 2010 02:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213193 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2010 02:57:45 -0000 Author: rmacklem Date: Mon Sep 27 02:57:44 2010 New Revision: 213193 URL: http://svn.freebsd.org/changeset/base/213193 Log: MFC: r212834 Fix nfsrv_freeallnfslocks() in the experimental NFSv4 server so that it frees local locks correctly upon close. In order for nfsrv_localunlock() to work correctly, the lock can no longer be in the lockowner's stateid list. As such, nfsrv_freenfslock() has to be called before nfsrv_localunlock(), to get rid of the lock structure on the lockowner's stateid list. This only affected operation when local locks (vfs.newnfs.enable_locallocks=1) are enabled, which is not the default at this time. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Mon Sep 27 02:44:30 2010 (r213192) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Mon Sep 27 02:57:44 2010 (r213193) @@ -1137,6 +1137,7 @@ nfsrv_freeallnfslocks(struct nfsstate *s struct nfslockfile *lfp = NULL; int gottvp = 0; vnode_t tvp = NULL; + uint64_t first, end; lop = LIST_FIRST(&stp->ls_lock); while (lop != LIST_END(&stp->ls_lock)) { @@ -1167,14 +1168,16 @@ nfsrv_freeallnfslocks(struct nfsstate *s if (tvp != NULL) { if (cansleep == 0) panic("allnfs2"); - nfsrv_localunlock(tvp, lfp, lop->lo_first, - lop->lo_end, p); + first = lop->lo_first; + end = lop->lo_end; + nfsrv_freenfslock(lop); + nfsrv_localunlock(tvp, lfp, first, end, p); LIST_FOREACH_SAFE(rlp, &lfp->lf_rollback, rlck_list, nrlp) free(rlp, M_NFSDROLLBACK); LIST_INIT(&lfp->lf_rollback); - } - nfsrv_freenfslock(lop); + } else + nfsrv_freenfslock(lop); lop = nlop; } if (vp == NULL && tvp != NULL)