Page MenuHomeFreeBSD

ufs: st_rdev is only meaningful for special nodes
ClosedPublic

Authored by kib on Aug 17 2025, 1:05 PM.
Tags
None
Referenced Files
F166823838: D51943.id160453.diff
Sun, Aug 16, 9:15 PM
Unknown Object (File)
Sat, Aug 15, 3:18 AM
Unknown Object (File)
Sat, Aug 15, 1:29 AM
Unknown Object (File)
Thu, Aug 13, 1:48 PM
Unknown Object (File)
Sat, Aug 8, 5:55 PM
Unknown Object (File)
Fri, Aug 7, 7:45 AM
Unknown Object (File)
Fri, Aug 7, 7:45 AM
Unknown Object (File)
Fri, Aug 7, 7:45 AM
Subscribers

Details

Summary
Instead of leaking di_db[0] (for regular files this is the index of the
first block of the file), return NODEV when not a special node.

Reported by:    des

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Aug 17 2025, 1:05 PM

There are 46 instances of (foo->v_type == VBLK || foo->v_type == VCHR) or its negation in the tree, and this adds four. That's probably a sign that we should have a macro for it.

This revision is now accepted and ready to land.Aug 17 2025, 1:52 PM