[PANIC] ufs_dirbad: bad dir
Matthew Dillon
dillon at apollo.backplane.com
Sun Oct 16 15:45:01 PDT 2005
Ach. sigh. Another false alarm. Sorry. The code is fine. It's
because the 'end' block is calculated inclusively, e.g.
end_lbn = start_lbn + len - 1. I'm still investigating it.
There is a bug if the range reallocblks is called with spans
more then two blockmaps, but I don't think that case can occur in real
life due to limitations in the range passed by the caller. Probably
worth a KASSERT, though.
-Matt
Matthew Dillon
<dillon at backplane.com>
: /*
: * 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
More information about the freebsd-current
mailing list