fix the problem reported in kern/35457, "cant mount msdosfs on floppy".

Since 1.40, which introduced support for non-DEV_BSIZE media,
mounting msdos floppy returned ENOTTY.

This is because floppy driver does not support DIOCGPART or DIOCWEDGEINFO
ioctl.

Those ioctls should not be a requirement for mounting msdosfs.

This patch is made by Christian Biere.
This commit is contained in:
kochi 2007-02-17 18:39:15 +00:00
parent 1f32eee360
commit 2794f98855
1 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vfsops.c,v 1.43 2007/01/22 16:07:33 reinoud Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.44 2007/02/17 18:39:15 kochi Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.43 2007/01/22 16:07:33 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.44 2007/02/17 18:39:15 kochi Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -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;