# DF-3108 — `ufs_dirbad()` panics a RW-mounted UFS on any mangled directory entry

## What

```c
601: ufs_dirbad(struct inode *ip, doff_t offset, char *how)
608:	if ((mp->mnt_flag & MNT_RDONLY) == 0)
609:		panic("ufs_dirbad: bad dir");
```

`ufs_lookup()`'s walk calls this (:269, "mangled entry"; also :435,
"i_size too small") whenever an entry fails the forward-progress check —
e.g. `d_reclen == 0` or `d_reclen > DIRBLKSIZ - (off & (DIRBLKSIZ-1))`,
i.e. **one flipped byte** in any directory block. On a filesystem mounted
read-write the kernel panics instantly.

This is the UFS instance of the fail-stop pattern filed for ext2 as
DF-3083 (ext2_dirbad): mounting an untrusted/corrupted image and doing a
single path lookup *inside* the affected directory reboots the machine;
the panic re-triggers on every boot script / user that touches the mount,
making it reboot-loopable when the crafted image is involved in boot or
autofs.

## Reproduce

```
cc -O2 -o patch_one patch_one.c     # flips /d's first d_reclen: 12 -> 516
./repro.sh                          # newfs image, corrupt 1 byte, mount RW,
                                     # stat /mnt/df3108/d/x  -> walk inside /d
```

Observed (guest, stock INVARIANTS kernel; also re-confirmed on the
DF-3106-patched kernel — independent bug):

```
/dev/vn7: bad dir ino 3 at offset 0: mangled entry
panic: ufs_dirbad: bad dir
ufs_dirbad() at ufs_dirbad+0x4b
ufs_lookup() at ufs_lookup+0x47a
vop_old_lookup() ... vop_nresolve()
```

Note: `ls` alone does NOT trigger it (VOP_READDIR uses ufs_readdir's
lenient walk) — resolving a name *inside* the corrupted directory does.
Three additional incidental reproductions were captured during DF-3106's
PoC development (mangled entries at offsets 168/500/508 in vn-mounted RW
images; identical panic signature).

## Fix direction

Downgrade the RW case from `panic()` to a printf + error return (the
walk already skips forward past mangled entries), matching the direction
upstream discussions have taken for ext2_dirbad (DF-3083): a corrupted
filesystem image must not be able to reboot the machine once mounted.
