Page MenuHomeFreeBSD

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

Authored by stevek on Feb 10 2017, 5:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 10:45 AM
Unknown Object (File)
Oct 3 2024, 9:27 PM
Unknown Object (File)
Oct 1 2024, 8:16 PM
Unknown Object (File)
Sep 29 2024, 12:54 AM
Unknown Object (File)
Sep 28 2024, 10:17 AM
Unknown Object (File)
Sep 27 2024, 10:18 AM
Unknown Object (File)
Sep 21 2024, 12:33 AM
Unknown Object (File)
Sep 8 2024, 10:57 PM
Subscribers

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
Lint Not Applicable
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.