Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: panic while mounting msdosfs



On Fri Jan 04 2008 at 01:54:53 +0100, Jukka Salmi wrote:
> > (gdb) p/x *b710
> > $1 = {bpbBytesPerSec = {0x2, 0x0}, bpbSecPerClust = 0x8, bpbResSectors = 
> > {0x0, 
> >     0x2}, bpbFATs = 0x2, bpbRootDirEnts = {0x0, 0x0}, bpbSectors = {0x0, 
> > 0x0}, 
> >   bpbMedia = 0xf8, bpbFATsecs = {0x0, 0x0}, bpbSecPerTrack = {0x3f, 0x0}, 
> >   bpbHeads = {0xff, 0x0}, bpbHiddenSecs = {0x0, 0x0, 0x0, 0x0}, 
> >   bpbHugeSectors = {0xb1, 0xd4, 0x79, 0x0}, bpbBigFATsecs = {0x0, 0x0, 0x0, 
> >     0x0}, bpbExtFlags = {0x0, 0x0}, bpbFSVers = {0x0, 0x0}, bpbRootClust = {
> >     0x0, 0x0, 0x0, 0x0}, bpbFSInfo = {0x0, 0x0}, bpbBackup = {0x0, 0x0}, 
> >   bpbReserved = {0x0 <repeats 12 times>}}
> > 
> > bpbBigFATsecs is 0.  This means that the file allocation table is 0 bytes
> > in size.  Not much info will fit into 0 bytes ...  Anyway, this causes
> > the fs to try to read 0 bytes using bread().  bread() does not like
> > being bothered with such trivial tasks and panics the kernel as revenge.
> > 
> > The attached patch (I'll commit it soon) refuses to mount non-fatty FATs:
> > rump/fs/bin/msdosfs> ./msdosfs ~/img/msdosfs.img /mnt
> > msdosfs: VFS_MOUNT 22
> > msdosfs: mount: Invalid argument
> > 
> > I'm curious though, can you try using the file system image on any
> > other OS?
> 
> Linux is able to mount it (while printing lots of warnings), sees some
> directories and files, but trying to read these files results in I/O
> errors.

Ok, so the file system contains the directories, but since the FAT is
missing, you don't know where the blocks for the files are.  Makes sense,
although I don't see why it can't read the first cluster of a file
(unless they're set to 0 in the directory entries).

Anyway .. if you want to see NetBSD be able to use broken FAT images
better, file a PR.

-- 
Antti Kantee <pooka%iki.fi@localhost>                     Of course he runs 
NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"



Home | Main Index | Thread Index | Old Index