Here's an initial, lightly-tested solution to the VG-consistency part. It does not address the issue of checking that a given LV is used with a consistent sector size. Perhaps if a user overrides the VG consistency check, it should be their responsibility to ensure LVs are consistent.
vgcreate/vgextend: check for inconsistent logical block sizes
When creating or extending a VG, check if the PVs have
inconsisent logical block sizes (value from BLKSSZGET ioctl).
If so, return an error. The error can be changed to a warning,
allowing the command to proceed with the mixed values, by
setting lvm.conf allow_mixed_logical_block_sizes=1.
Here's an initial, lightly-tested solution to the VG-consistency part. It does not address the issue of checking that a given LV is used with a consistent sector size. Perhaps if a user overrides the VG consistency check, it should be their responsibility to ensure LVs are consistent.
https:/ /sourceware. org/git/ ?p=lvm2. git;a=commit; h=dd6ff9e3a7580 1fc5c6166aa0983 fa8df098e91a
vgcreate/vgextend: check for inconsistent logical block sizes
When creating or extending a VG, check if the PVs have logical_ block_sizes= 1.
inconsisent logical block sizes (value from BLKSSZGET ioctl).
If so, return an error. The error can be changed to a warning,
allowing the command to proceed with the mixed values, by
setting lvm.conf allow_mixed_