Page MenuHomeFreeBSD

Output file name from "preload" type md(4) device
ClosedPublic

Authored by stevek on Feb 10 2017, 5:22 PM.

Details

Summary

For MD_PRELOAD type md(4) devices, if there is a file name in the preloaded
meta-data, copy it into the softc structure.

When returning md(4) device details to the caller, include the file name in
any MD_PRELOAD type devices if it is set (first character is not NUL.)

In mdconfig, for "preload" type md(4) devices, if there is file config
available, print it in the file column of the output.

Test Plan

Built and tested on x86 and ARM by pre-loading ISO images from the loader and
checking mdconfig output. Also created other md types to ensure output from
mdconfig looks correct.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stevek retitled this revision from to Output file name from "preload" type md(4) device.
stevek updated this object.
stevek edited the test plan for this revision. (Show Details)
stevek added a reviewer: brooks.
brooks edited edge metadata.

Looks good to me.

sys/dev/md/md.c
1694 ↗(On Diff #24970)

Not new in your code, but this case is awful. It does does a copyout to the buffer and just hopes it's at least PATH_MAX.

This revision is now accepted and ready to land.Feb 10 2017, 5:34 PM
sys/dev/md/md.c
1694 ↗(On Diff #24970)

yes, the problem is the md_ioctl structure does not have a size for the md_file member and it really should.

This revision was automatically updated to reflect the committed changes.