Comment 22 for bug 1817097

Revision history for this message
In , teigland (teigland-redhat-bugs) wrote :

pushed to master branch:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=0404539edb25e4a9d3456bb3e6b402aa2767af6b

I can push to stable if this bug gets a rhel7 ack.

commit 0404539edb25e4a9d3456bb3e6b402aa2767af6b
Author: David Teigland <email address hidden>
Date: Thu Aug 1 10:06:47 2019 -0500

    vgcreate/vgextend: restrict PVs with mixed block sizes

    Avoid having PVs with different logical block sizes in the same VG.
    This prevents LVs from having mixed block sizes, which can produce
    file system errors.

    The new config setting devices/allow_mixed_block_sizes (default 0)
    can be changed to 1 to return to the unrestricted mode.

[root@null-01 ~]# blockdev --getss --getpbsz /dev/sdh
4096
2097152
[root@null-01 ~]# blockdev --getss --getpbsz /dev/loop0
512
512

[root@null-01 ~]# vgcreate mix /dev/sdh /dev/loop0
  Devices have inconsistent logical block sizes (4096 and 512).
  See lvm.conf allow_mixed_block_sizes.

[root@null-01 ~]# vgcreate --config devices/allow_mixed_block_sizes=1 mix /dev/loop0 /dev/sdh
  Volume group "mix" successfully created with system ID one

[root@null-01 ~]# vgcreate mix /dev/sdh
  Volume group "mix" successfully created with system ID one

[root@null-01 ~]# vgextend mix /dev/loop0
  Devices have inconsistent logical block sizes (4096 and 512).

[root@null-01 ~]# vgextend --config devices/allow_mixed_block_sizes=1 mix /dev/loop0
  Volume group "mix" successfully extended