From owner-freebsd-current Thu Apr 4 12:14:52 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA26361 for current-outgoing; Thu, 4 Apr 1996 12:14:52 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA26355 for ; Thu, 4 Apr 1996 12:14:50 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA22425; Thu, 4 Apr 1996 13:10:04 -0700 From: Terry Lambert Message-Id: <199604042010.NAA22425@phaeton.artisoft.com> Subject: Re: 2.2-960323 Panic in mount_msdos To: franky@pinewood.nl (Frank ten Wolde) Date: Thu, 4 Apr 1996 13:10:04 -0700 (MST) Cc: freebsd-current@FreeBSD.ORG In-Reply-To: <9604041520.ZM3696@pwood1.pinewood.nl> from "Frank ten Wolde" at Apr 4, 96 03:20:03 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I just tried to mount a Windows NT file system (NTFS) using: > > mount -t msdos /dev/sd0s2 /dos > > (I thought it was an MSDOS-FAT file system :-). The 2.2-960223-SNAPSHOT > of FreeBSD immediately paniced: [ ... ] > I know you cannot mount an NTFS under FreeBSD, but at least the system > should not crash. > > I just report this problem as I have too little knowledge of the internals > of the kernel to fix the problem myself :-) A file system operates by copying on disk strucutures into memory and then using the offsets in the coppy to access additional memory. It does not bounds-check these accesses. If there is a problem with this, it's that the DOSFS did not validate that the device was in fact a DOS partition before going gung-ho into dereferencing. Not bounds-checking dereferences isn't an error; it an optimization, and it's allowable because mount is not a user accessable command (you have to be root). The fix for inconsistent media is to run fsck (or equivalent) on it before attempting a mount; the fix is procedural, in other words, and doesn't require a change to the mount code. The DOSFS code is, unfortunately, well known to be unstable. It does not do the type validation it should, ad there is not a fsck equivalent program as part of the package. The DOSFS is being rewritten (not by me). For now, make sure that you have chkdsk'ed the DOS disk prior to booting FreeBSD. If it fails chkdsk, do not attempt to mount it. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.