From owner-svn-src-all@FreeBSD.ORG Wed Mar 3 21:59:45 2010 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 C504F10656F0; Wed, 3 Mar 2010 21:59:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48B18FC13; Wed, 3 Mar 2010 21:59:45 +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 o23Lxj6b078026; Wed, 3 Mar 2010 21:59:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o23Lxj04078024; Wed, 3 Mar 2010 21:59:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003032159.o23Lxj04078024@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Mar 2010 21:59:45 +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: r204675 - head/sys/fs/msdosfs 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: Wed, 03 Mar 2010 21:59:45 -0000 Author: kib Date: Wed Mar 3 21:59:45 2010 New Revision: 204675 URL: http://svn.freebsd.org/changeset/base/204675 Log: When returning error from msdosfs_lookup(), make sure that *vpp is NULL. lookup() KASSERTs this condition. Reported and tested by: pho MFC after: 3 weeks Modified: head/sys/fs/msdosfs/msdosfs_lookup.c Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Wed Mar 3 21:59:23 2010 (r204674) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Wed Mar 3 21:59:45 2010 (r204675) @@ -125,14 +125,14 @@ msdosfs_lookup_(struct vnode *vdp, struc #endif dp = VTODE(vdp); pmp = dp->de_pmp; - if (vpp != NULL) - *vpp = NULL; #ifdef MSDOSFS_DEBUG printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n", vdp, dp, dp->de_Attributes); #endif restart: + if (vpp != NULL) + *vpp = NULL; /* * If they are going after the . or .. entry in the root directory, * they won't find it. DOS filesystems don't have them in the root @@ -525,8 +525,10 @@ foundroot: pdp = vdp; if (flags & ISDOTDOT) { error = msdosfs_deget_dotdot(pdp, cluster, blkoff, vpp); - if (error) + if (error) { + *vpp = NULL; return (error); + } /* * Recheck that ".." still points to the inode we * looked up before pdp lock was dropped. @@ -534,6 +536,7 @@ foundroot: error = msdosfs_lookup_(pdp, NULL, cnp, &inode1); if (error) { vput(*vpp); + *vpp = NULL; return (error); } if (VTODE(*vpp)->de_inode != inode1) {