NetBSD Problem Report #7380

Received: (qmail 23395 invoked from network); 14 Apr 1999 08:45:33 -0000
Message-Id: <19990414084414.B26371CFC@mabelode.imrryr.org>
Date: Wed, 14 Apr 1999 01:44:14 -0700 (PDT)
From: elric@imrryr.org
Reply-To: elric@imrryr.org
To: gnats-bugs@gnats.netbsd.org
Subject: vnode disks fail on MSDOSFS files.
X-Send-Pr-Version: 3.95

>Number:         7380
>Category:       kern
>Synopsis:       vnode disks fail on MSDOSFS files.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 14 01:50:01 +0000 1999
>Closed-Date:    Wed Apr 21 18:38:02 +0000 1999
>Last-Modified:  Wed Apr 21 18:38:51 +0000 1999
>Originator:     R. C. Dowdeswell
>Release:        NetBSD 1.4_ALPHA
>Organization:

>Environment:

System: NetBSD mabelode.imrryr.org 1.4_ALPHA NetBSD 1.4_ALPHA (MABELODE) #1: Wed Apr 14 01:28:20 PDT 1999 elric@mabelode.imrryr.org:/usr/src/sys/arch/alpha/compile/MABELODE alpha


>Description:
	If one points a vnd at a file residing in an MSDOSFS,
	the virtual disk does not properly represent the data
	in the file.

>How-To-Repeat:
	# mount -t msdos /dev/wd0e /mnt/
	# cd /mnt/
	# jot 131072 > fs
	# vnconfig vnd0 fs
	# more /dev/rvnd0d

	notice that you basically get a lot of odd repititions.
	certainly not what you might have expected.
>Fix:
	I think that the problem is basically that msdosfs_bmap()
	calls pcbmap() converting clusters into blocks.  But,
	in msdosfs a "cluster" is what a "block" is in FFS.

	This patch got me going, and able to create an FFS in a
	file on an MSDOSFS, and run some tars and mtrees to check
	out that it was working.

*** msdosfs_vnops.c.orig        Wed Apr 14 00:58:01 1999
--- msdosfs_vnops.c     Wed Apr 14 01:05:11 1999
***************
*** 1757,1763 ****
                int *a_runp;
        } */ *ap = v;
        struct denode *dep = VTODE(ap->a_vp);
-       struct msdosfsmount *pmp = dep->de_pmp;

        if (ap->a_vpp != NULL)
                *ap->a_vpp = dep->de_devvp;
--- 1757,1762 ----
***************
*** 1769,1775 ****
                 */
                *ap->a_runp = 0;
        }
!       return (pcbmap(dep, de_bn2cn(pmp, ap->a_bn), ap->a_bnp, 0, 0));
  }

  int
--- 1768,1774 ----
                 */
                *ap->a_runp = 0;
        }
!       return (pcbmap(dep, ap->a_bn, ap->a_bnp, 0, 0));
  }

  int

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: abs 
State-Changed-When: Wed Apr 21 11:38:02 PDT 1999 
State-Changed-Why:  
Applied supplied patch to trunk, and releng have pulled up into 1.4 branch. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.