Date: Sun, 16 Oct 2005 15:11:35 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: obrien@freebsd.org, freebsd-current@freebsd.org Subject: Re: [PANIC] ufs_dirbad: bad dir Message-ID: <200510162211.j9GMBZED037255@apollo.backplane.com> References: <20050926152952.GA1670@dragon.NUXI.org> <20050926160808.GB1649@dragon.NUXI.org> <200510141940.j9EJeYsn024832@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Going through all this badly documented filesystem code is
aweful.
Could someone check the reallocblks code? Specifically this:
/*
* If the block range spans two block maps, get the second map.
*/
if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) {
ssize = len;
} else {
#ifdef DIAGNOSTIC
if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
panic("ffs_reallocblk: start == end");
#endif
ssize = len - (idp->in_off + 1);
^^^^^^^^^^^^^^^^^^^^^
This doesn't look right. It kinda seems to me
that it should be (len - idp->in_off).
if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, &ebp))
goto fail;
ebap = (ufs_daddr_t *)ebp->b_data;
}
I went through about 3 or 4 false alarms earlier today, and this could
be another one. But if it is wrong it would fit the symptoms....
the first indirect block in the inode getting blown to bits.
-Matt
Matthew Dillon
<dillon@backplane.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510162211.j9GMBZED037255>
