Subject: Re: kern/35457: can't mount msdos fs on floppy anymore
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 01/22/2007 18:05:04
The following reply was made to PR kern/35457; it has been noted by GNATS.

From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/35457: can't mount msdos fs on floppy anymore
Date: Mon, 22 Jan 2007 19:10:37 +0100

 Jukka Salmi wrote:
 >  Christian Biere wrote:
 >  >  I can't tell whether the following is a complete fix but it seems to restore
 >  >  the original behaviour with respect to floppies. I've checked it under qemu.
 >  [...]
 >  
 >  Hmm, this is too different from HEAD, I don't know how to apply your
 >  patch. Could you provide a diff against rev 1.42?
 
 
 Index: sys/fs/msdosfs/msdosfs_vfsops.c
 ===================================================================
 RCS file: /cvsroot/src/sys/fs/msdosfs/msdosfs_vfsops.c,v
 retrieving revision 1.43
 diff -u -p -r1.43 msdosfs_vfsops.c
 --- sys/fs/msdosfs/msdosfs_vfsops.c	22 Jan 2007 16:07:33 -0000	1.43
 +++ sys/fs/msdosfs/msdosfs_vfsops.c	22 Jan 2007 18:01:44 -0000
 @@ -489,15 +489,21 @@ msdosfs_mountfs(devvp, mp, l, argp)
  		struct dkwedge_info dkw;
  		error = VOP_IOCTL(devvp, DIOCGWEDGEINFO, &dkw, FREAD,
  		    NOCRED, l);
 -		if (error) {
 -			DPRINTF(("Error getting partition info %d\n", error));
 -			goto error_exit;
 -		}
  		secsize = 512;	/* XXX */
  		dtype = DTYPE_FLOPPY; /* XXX */
 -		fstype = strcmp(dkw.dkw_ptype, DKW_PTYPE_FAT) == 0 ?
 -		    FS_MSDOS : -1;
 -		psize = dkw.dkw_size;
 +		fstype = FS_MSDOS;
 +		psize = -1;
 +		if (error) {
 +			if (error != ENOTTY) {
 +				DPRINTF(("Error getting partition info %d\n",
 +					error));
 +				goto error_exit;
 +			}
 +		} else {
 +			fstype = strcmp(dkw.dkw_ptype, DKW_PTYPE_FAT) == 0 ?
 +		    		FS_MSDOS : -1;
 +			psize = dkw.dkw_size;
 +		}
  	}
  	if (argp->flags & MSDOSFSMNT_GEMDOSFS) {
  		bsize = secsize;