HomeFreeBSD

linsysfs: error check device-directory creation

Description

linsysfs: error check device-directory creation

This one in particular is ripe with opportunities to trigger a duplicate
node error in pfs_create_dir(), so we do actually want to error-check
it. The rest, more or less, should be expected not to fail. We'll
propagate the error from pfs_create_dir() up through linsysfs_run_bus
and complain about the device node that caused the error. Note that we
avoid failing vfs_init() since a partially-constructed linsysfs with
missing devices is probably more useful than missing linsysfs entirely.

While we're here, convert two malloc() that weren't being error checked
to M_WAITOK -- we already wait in the rest of the function, might as
well do the same here.

Add a missing newline to the pseudofs error mesage.

Reviewed by: fuz, kib
Differential Revision: https://reviews.freebsd.org/D52038

Details

Provenance
kevansAuthored on Sep 4 2025, 2:08 AM
Reviewer
fuz
Differential Revision
D52038: linsysfs: error check device-directory creation
Parents
rG6d33507ff9b8: vfs: handle vfs_init() failures
Branches
Unknown
Tags
Unknown