mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
growfs: do not error if filesystem is already requested size
For some cloud/virtualization use cases it can be convenient to grow the
filesystem on boot any time the disk/partition happens to be larger, but
not fail if it remains the same size.
Continue to emit a message if we have no action to take, but exit with
status 0 if the size remains the same.
Reviewed by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32856
(cherry picked from commit 3f9acedb02)
This commit is contained in:
parent
111619ff70
commit
cf09094e39
1 changed files with 4 additions and 1 deletions
|
|
@ -1503,7 +1503,10 @@ main(int argc, char **argv)
|
|||
humanize_number(newsizebuf, sizeof(newsizebuf), size,
|
||||
"B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
|
||||
|
||||
errx(1, "requested size %s is not larger than the current "
|
||||
if (size == (uint64_t)(osblock.fs_size * osblock.fs_fsize))
|
||||
errx(0, "requested size %s is equal to the current "
|
||||
"filesystem size %s", newsizebuf, oldsizebuf);
|
||||
errx(1, "requested size %s is smaller than the current "
|
||||
"filesystem size %s", newsizebuf, oldsizebuf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue