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
Unknown Object (File)
Thu, May 21, 4:42 PM
Unknown Object (File)
Wed, May 20, 8:02 AM
Unknown Object (File)
Sun, May 17, 12:13 AM
Unknown Object (File)
Wed, Apr 29, 4:19 PM
Unknown Object (File)
Wed, Apr 29, 3:42 PM
Unknown Object (File)
Mon, Apr 27, 1:31 PM
Unknown Object (File)
Apr 23 2026, 10:30 PM
Unknown Object (File)
Apr 16 2026, 9:28 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