From owner-svn-src-stable@FreeBSD.ORG Wed Jan 11 01:24:36 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE541065675; Wed, 11 Jan 2012 01:24:36 +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 CEE208FC17; Wed, 11 Jan 2012 01:24:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0B1OZ4k036194; Wed, 11 Jan 2012 01:24:35 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B1OZFC036192; Wed, 11 Jan 2012 01:24:35 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201110124.q0B1OZFC036192@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Jan 2012 01:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229953 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 01:24:36 -0000 Author: rmacklem Date: Wed Jan 11 01:24:35 2012 New Revision: 229953 URL: http://svn.freebsd.org/changeset/base/229953 Log: MFC: r228827 During investigation of an NFSv4 client crash reported by glebius@, jhb@ spotted that nfscl_getstateid() might modify credentials when called from nfsrpc_read() for the case where p != NULL, whereas nfsrpc_read() only did a crdup() to get new credentials for p == NULL. This bug was introduced by r195510, since pre-r195510 nfscl_getstateid() only modified credentials for the p == NULL case. This patch modifies nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case. It is conceivable that this bug caused the crash reported by glebius@, but that will not be determined for some time, since the crash occurred after about 1month of operation. Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:09:08 2012 (r229952) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:24:35 2012 (r229953) @@ -1232,8 +1232,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop newcred = cred; if (NFSHASNFSV4(nmp)) { nfhp = np->n_fhp; - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); } retrycnt = 0; do { @@ -1263,7 +1262,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop expireret == 0 && clidrev != 0 && retrycnt < 4)); if (error && retrycnt >= 4) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); } @@ -1384,8 +1383,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio clidrev = nmp->nm_clp->nfsc_clientidrev; newcred = cred; if (NFSHASNFSV4(nmp)) { - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); nfhp = np->n_fhp; } retrycnt = 0; @@ -1435,7 +1433,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio ((error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER) && called_from_strategy != 0))) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); }