Subject: kern/4394: MSDOSFS_DEBUG broken
To: None <netbsd-bugs@NetBSD.ORG>
From: Rick Byers <rickb@iaw.on.ca>
List: netbsd-bugs
Date: 11/14/1997 20:51:14
>Number:         4394
>Category:       kern
>Synopsis:       Kernel will panic during msdosfs_mount if MSDOSFS_DEBUG is on
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 31 10:20:04 1997
>Originator:     Rick Byers
>Organization:
=========================================================================
Rick Byers                                      Internet Access Worldwide
rickb@iaw.on.ca                                              System Admin
University of Waterloo, Computer Science                    (905)714-1400
http://www.iaw.on.ca/rickb/                         http://www.iaw.on.ca/
>Release:        October 25, 1997
>Environment:

        
System: NetBSD rickb 1.3_ALPHA NetBSD 1.3_ALPHA (RICKB) #22: Thu Oct 30 02:01:5
3 EST 1997 root@rickb:/usr/src/sys/arch/i386/compile/RICKB i386




>Description:
        There are two places in msdosfs_vfsops.c which will cause a kernel
        panic during mount if MSDOSFS_DEBUG is enabled.  I should have caught
        this on my previous pr, sorry.
>How-To-Repeat:
        Try turning on MSDOSFS_DEBUG and mounting a msdosfs filesystem
>Fix:
        Apply the following patch.

Index: msdosfs_vfsops.c
===================================================================
RCS file: /usr/cvsroot/netbsd/src/sys/msdosfs/msdosfs_vfsops.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** msdosfs_vfsops.c	1997/10/30 06:18:08	1.2
--- msdosfs_vfsops.c	1997/10/30 07:03:50	1.3
***************
*** 345,351 ****
  	    &size);
  	bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
  #ifdef MSDOSFS_DEBUG
! 	printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap);
  #endif
  	return (0);
  }
--- 345,351 ----
  	    &size);
  	bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
  #ifdef MSDOSFS_DEBUG
! 	printf("msdosfs_mount(): mp %p, pmp %p\n", mp, pmp); 
  #endif
  	return (0);
  }
***************
*** 784,795 ****
  	struct denode *ndep;
  	int error;
  
  #ifdef MSDOSFS_DEBUG
  	printf("msdosfs_root(); mp %p, pmp %p, ndep %p, vp %p\n",
  	    mp, pmp, ndep, DETOV(ndep));
  #endif
- 	if ((error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, &ndep)) != 0)
- 		return (error);
  	*vpp = DETOV(ndep);
  	return (0);
  }
--- 784,795 ----
  	struct denode *ndep;
  	int error;
  
+ 	if ((error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, &ndep)) != 0)
+ 		return (error);
  #ifdef MSDOSFS_DEBUG
  	printf("msdosfs_root(); mp %p, pmp %p, ndep %p, vp %p\n",
  	    mp, pmp, ndep, DETOV(ndep));
  #endif
  	*vpp = DETOV(ndep);
  	return (0);
  }

>Audit-Trail:
>Unformatted:


>Last-Modified:



=========================================================================
Rick Byers                                      Internet Access Worldwide
rickb@iaw.on.ca                                		     System Admin
University of Waterloo, Computer Science                    (905)714-1400
http://www.iaw.on.ca/rickb/                         http://www.iaw.on.ca/