Page MenuHomeFreeBSD

Improvements to growfs rc script
ClosedPublic

Authored by scottl on Aug 17 2021, 4:51 PM.
Tags
None
Referenced Files
F102169585: D31587.diff
Fri, Nov 8, 11:31 AM
Unknown Object (File)
Thu, Oct 24, 2:52 AM
Unknown Object (File)
Sat, Oct 19, 5:55 PM
Unknown Object (File)
Sep 12 2024, 4:12 PM
Unknown Object (File)
Sep 12 2024, 11:32 AM
Unknown Object (File)
Sep 12 2024, 11:32 AM
Unknown Object (File)
Sep 12 2024, 11:31 AM
Unknown Object (File)
Sep 12 2024, 11:25 AM
Subscribers
None

Details

Summary

Authored by Luiz at Netgate

  1. Fix the growfs rc script to cope with diskid labels.
  2. Fix a warning in growfs. gpart commit is supposed to be called on disk device.
  3. Silence a gpart commit warning in growfs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

scottl created this revision.
This revision is now accepted and ready to land.Aug 17 2021, 5:15 PM
brd retitled this revision from Improvements to grows rc script to Improvements to growfs rc script.Aug 17 2021, 5:43 PM

I've read through this a few times, and am still not clear why this is an improvement, so the commit message should include that information as well. It appears to be something to do with labels or other root names with '/' in them.
Also next time, please use the arc tools, or create the context diff with -U999999 to get the full context for the review. Without it, it's hard to review changes since the larger context isn't available.

libexec/rc/rc.d/growfs
57

"while read x1 _type _dev rest" above would obviate the need for his awkward construct here.

58

${1} is a bit unclear from context. I'd recommend a local variable set at the top of this function to hold its value and give it some additional semantic meaning"

86

This quoting is awkard and error-prone.

I'd suggest (glabel status | awk -v rootdev=$rootdev '{index(rootdev, $1) { print $3; }) instead since that's clearer and avoids the quoting and unquoting to get the variable substituted.

I'm not sure what you're asking for at first that's not included in the summary

I'm not sure what you're asking for at first that's not included in the summary

Sorry, just saw the subject line and got confused. The summery is good.