HomeFreeBSD

Check ashift validity in 'zpool add'

Description

Check ashift validity in 'zpool add'

df83110 added the ability to specify a custom "ashift" value from the command
line in 'zpool add' and 'zpool attach'. This commit adds additional checks to
the provided ashift to prevent invalid values from being used, which could
result in disastrous consequences for the whole pool.

Additionally provide ASHIFT_MAX and ASHIFT_MIN definitions in spa.h.

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #5878

Details

Provenance
LOLi <loli10K@users.noreply.github.com>Authored on Mar 29 2017, 12:21 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 29 2017, 12:21 AM
Parents
rG12aec7dcd9b1: Fix wrong offset args in vdev_cache_write
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGff61d1a49590: Check ashift validity in 'zpool add' (authored by LOLi <loli10K@users.noreply.github.com>).Mar 29 2017, 12:21 AM