]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Check for minimum partition size
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 16 Feb 2024 17:07:32 +0000 (09:07 -0800)
committerGitHub <noreply@github.com>
Fri, 16 Feb 2024 17:07:32 +0000 (09:07 -0800)
commitaf4da5ccf28e1de6d4f6771a8d9d7cc578aba087
tree9c5e891fe94e50f2c7a79675b3e37eea79a69a8f
parentd6a3d3f12a6455cf813fc4d207d66e78a5e8b4ca
Check for minimum partition size

On Linux block devices used for vdevs will by partitioned.  The block
device must be large enough for an 64M partition starting at offset
of 2048 sectors (part1), and a second 64M reserved partition at the
end of the device (part9).

This commit adds a capacity check when creating the GPT label to
immediately detect a device which is too small.  With the existing
code this would be caught slightly latter when attempting to use
the partition.  Catching it sooner let's us print a more useful error.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15898
lib/libzfs/os/linux/libzfs_pool_os.c