From mellon@happy.checkpoint.com  Thu May 11 09:10:52 2000
Return-Path: <mellon@happy.checkpoint.com>
Received: from happy.checkpoint.com (happy.checkpoint.com [199.203.156.41])
	by hub.freebsd.org (Postfix) with ESMTP id BA18E37BDE2
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 May 2000 09:10:44 -0700 (PDT)
	(envelope-from mellon@happy.checkpoint.com)
Received: (from mellon@localhost)
	by happy.checkpoint.com (8.9.3/8.9.3) id TAA25719;
	Thu, 11 May 2000 19:11:26 GMT
	(envelope-from mellon)
Message-Id: <200005111911.TAA25719@happy.checkpoint.com>
Date: Thu, 11 May 2000 19:11:26 GMT
From: mellon@pobox.com
Sender: mellon@happy.checkpoint.com
Reply-To: mellon@pobox.com
To: FreeBSD-gnats-submit@freebsd.org
Subject:
X-Send-Pr-Version: 3.2

>Number:         18503
>Category:       kern
>Synopsis:       check for error return from vfs_allocate_syncvnode()
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 11 09:20:00 PDT 2000
>Closed-Date:    Tue Feb 17 21:26:13 PST 2004
>Last-Modified:  Tue Feb 17 21:26:13 PST 2004
>Originator:     Anatoly Vorobey
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:

5.0-CURRENT

>Description:

Current code of mount() in vfs_syscalls.c does not check,
erroneously, for error return from vfs_allocate_syncvnode().
The failure scenario is very unlikely to happen, however
(it'll only fail if it can't obtain a vnode). The attached
fix will prudently refrain from ignoring the return value.

>How-To-Repeat:



>Fix:

Index: vfs_syscalls.c
===================================================================
RCS file: /freebsd/cvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.153
diff -u -r1.153 vfs_syscalls.c
--- vfs_syscalls.c	2000/05/05 09:58:27	1.153
+++ vfs_syscalls.c	2000/05/11 19:07:57
@@ -342,7 +342,7 @@
 		if ((mp->mnt_flag & MNT_RDONLY) == 0)
 			error = vfs_allocate_syncvnode(mp);
 		vfs_unbusy(mp, p);
-		if ((error = VFS_START(mp, 0, p)) != 0)
+		if (error || (error = VFS_START(mp, 0, p)) != 0)
 			vrele(vp);
 	} else {
 		simple_lock(&vp->v_interlock);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cperciva 
State-Changed-When: Tue Feb 17 21:25:45 PST 2004 
State-Changed-Why:  
Fixed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=18503 
>Unformatted:
