Re: MSDOSFS woes

From: Ruslan Ermilov <ru_at_FreeBSD.ORG>
Date: Wed, 6 Aug 2003 13:43:32 +0300
On Wed, Aug 06, 2003 at 08:05:52PM +1000, Tim Robbins wrote:
> On Sat, Aug 02, 2003 at 06:08:50PM +0300, Ruslan Ermilov wrote:
> 
> > Gang, :-)
> > 
> > While working with Marcel on a bootable CD-ROM for IA64 issue,
> > I've stumbled upon the following problem.  I needed to increase
> > the size of the EFI partition (which is an MS-DOS file system)
> > to 64M, and that made two of my machines stuck solidly -- a lot
> > of process are waiting on the "wdrain" event.
> 
> Interesting. Were you running with INVARIANTS on? I got a completely
> reproducible kernel panic when running your script, regardless of whether I
> used -F 12 or -F 16; it was trying to write file data past the end of the disk,
> and causing kernel memory pool to become corrupted. I was seeing Memory
> modified after free errors, with blocks most recently used by GEOM and file
> desc.
> 
> Were you running the script with INVARIANTS on?
> 
My kernel config includes the GENERIC config which has INVARIANTS on.

Further analysis of the problem shows that there are actually two
problems.

First problem is with newfs_msdos(8) (and kernel part of MSDOSFS).
newfs_msdos(8) sometimes results in a bad file system lying about
the number of available sectors (recorded in sector 0) than is
actually available, as was demonstrated by Bruce Evans (and I've
been able to reproduce this).  Sometimes, this results in warnings
from MSDOSFS on a console, immediately followed by a panic.
Sometimes, I also saw the "Memory modified after free".  IIRC,
I ended up with a conclusion that -s arguments >32M are unsafe
with newfs_msdos(8).

Second problem is with vnode-backed md(4) devices, and it is not
MSDOSFS-specific.  I've been able to reproduce the "wdrain" lockup
after attempting to newfs(8) and fill (with cpio(1)) an 11MB-only
vnode-backed UFS file system yesterday.  Sometimes it just works,
and sometimes it causes a lock-up.  I asked Poul-Henning to look
into this issue in a private message to him with more details and
a test case.


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru_at_sunbay.com		Sunbay Software Ltd,
ru_at_FreeBSD.org		FreeBSD committer

Received on Wed Aug 06 2003 - 01:43:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:17 UTC