Page MenuHomeFreeBSD

Restore backward compatibility for "attach" verb.
ClosedPublic

Authored by delphij on Oct 24 2018, 6:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 6:51 AM
Unknown Object (File)
Fri, Dec 20, 11:55 PM
Unknown Object (File)
Fri, Dec 20, 11:54 PM
Unknown Object (File)
Fri, Dec 20, 3:31 PM
Unknown Object (File)
Sun, Dec 1, 11:39 PM
Unknown Object (File)
Sun, Dec 1, 11:39 PM
Unknown Object (File)
Sun, Dec 1, 11:39 PM
Unknown Object (File)
Sun, Dec 1, 11:39 PM
Subscribers

Details

Summary

In r332361 and r333439, two new parameters were added to geli attach
verb using gctl_get_paraml, which requires the value to be present.
This would prevent old geli(8) binary from attaching geli(4) device
as they have no knowledge about the new parameters.

Restore backward compatibility by treating the absense of these two
values as seeing the default value supplied by userland.

Test Plan

Use old geli(8) binary to attach geli(4) device.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20440
Build 19878: arc lint + arc unit

Event Timeline

oshogbo requested changes to this revision.Oct 24 2018, 4:20 PM

Thanks for catching that.

sys/geom/eli/g_eli_ctl.c
63

Assigning values here is incorrect with style(9).

87

Do we need to get values twice?
Wouldn't it work as:

valp = gctl_get_paraml(req, "keyno", sizeof(*valp));
if (valp != NULL)
    nkey = *valp;
else
    nkey = -1;
This revision now requires changes to proceed.Oct 24 2018, 4:20 PM
delphij added inline comments.
sys/geom/eli/g_eli_ctl.c
63

Thanks, will fix.

87

Yes because counter-intuitively, gctl_get_paraml would set error for non-existent parameters (while gctl_get_param won't, which is (ab)used as a check for whether the parameter was supplied).

Address style(9) issues pointed out by oshogbo.

Please take another look, thanks!

This revision is now accepted and ready to land.Oct 26 2018, 7:02 PM
This revision was automatically updated to reflect the committed changes.