Autodetect on SSD results in ashift=9 but this is obviously nonsense. Please check whether the drive is rotational or not before propagating this brokenness onto my pool.
Do you propose to enforce some ashift for all non-rotatinf devices? I think it is very wrong assumption. If flash block us 32KB, it may have no big difference whether ashift is 9 or 12, both are equally bad, while bumping ashift to 12 may reduce space ZFS efficiency and increase disk and flash traffic without need.
If there is more than one way to detect the underlying device sector geometries, perhaps ZFS should use all of the along with rotational vs ssd, and provide a warning/error if there are discrepancies, forcing the user to explicitly set a value based on research of the device?
Do you propose to enforce some ashift for all non-rotatinf devices? I think it is very wrong assumption. If flash block us 32KB, it may have no big difference whether ashift is 9 or 12, both are equally bad, while bumping ashift to 12 may reduce space ZFS efficiency and increase disk and flash traffic without need.
This is not totally correct: while ashift=12 does not means aligning to flash page nowadays, SSD's controllers (and FTLs) are way more optimized to manage 4K writes rather than 512B ones.
I would propose a much simpler approach: simply let zfs create ashift=12 pools by default, leaving the choice of 512B (or other values) at user requests. This will solve 99% of user issues, leaving other users/sysadmins the power to specify different ashift when it make sense.
Note: I propose the above for both rotational (ie: HDD) and non-rotational (SSD, Optane, etc) storage devices. This will even have the good side effect of removing the device blacklist once included (still present?) in zfs.
Even if the code is still setting ashift based on legacy nonsense the docs have it straight.
Most helpful comment
This is not totally correct: while ashift=12 does not means aligning to flash page nowadays, SSD's controllers (and FTLs) are way more optimized to manage 4K writes rather than 512B ones.
I would propose a much simpler approach: simply let zfs create ashift=12 pools by default, leaving the choice of 512B (or other values) at user requests. This will solve 99% of user issues, leaving other users/sysadmins the power to specify different ashift when it make sense.
Note: I propose the above for both rotational (ie: HDD) and non-rotational (SSD, Optane, etc) storage devices. This will even have the good side effect of removing the device blacklist once included (still present?) in zfs.