Properly reset the fields in clean_unrhdr.
authormjoras <mjoras@FreeBSD.org>
Mon, 16 Oct 2017 16:14:50 +0000 (16:14 +0000)
committermjoras <mjoras@FreeBSD.org>
Mon, 16 Oct 2017 16:14:50 +0000 (16:14 +0000)
commit88e3a903b60e95612ec47821a1b45cc74ba7800d
tree76cc0396c1e86c4561e0f14b4bc79442f39929fb
parent95ee5810e620a9f1d07153daf3a7a4665fc534a9
Properly reset the fields in clean_unrhdr.

In r324542 I neglected to reset the first and last fields of struct
unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with
DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr.
While here, change a loop to use TAILQ_FOREACH_SAFE since it is more
readable and equally fast.

Reported by: David Wolfskill <david@catwhisker.org>
Approved by: rstone (mentor)
Sponsored by: Dell EMC Isilon
sys/kern/subr_unit.c