<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">We working on enabling 4k block size in oVirt block storage domain, built using VG</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">on multipath devices on shared storage.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">We have incomplete support for 4k, added in 2011, for this bug:</div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000">    <a href="https://bugzilla.redhat.com/732980">https://bugzilla.redhat.com/732980</a></font></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">When creating or extending a VG, we check that all PVs are using same logical and</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">phyisical block size, and we store both logical and physical block size in the VG tags.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">We get the block sizes from /sys/block/dm-X/queue/{logical,physical}_block_size.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">We also enforce that device physical block size is not smaller than logical block size,</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">This check was added in this patch, trying to enable block size != 512. There is no</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">explanation in the patch or in the review comments why we need to validate this.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default"><font color="#000000">    <a href="https://github.com/oVirt/vdsm/commit/7e79153705891a91a06eb31cd642fb209d10ff86">https://github.com/oVirt/vdsm/commit/7e79153705891a91a06eb31cd642fb209d10ff86</a></font><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">When we start to use a VG, we validate that all the devices are using the stored logical</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">and physical block size.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">In vdsm itself, we use the logical block size to manage vdsm metadata, assuming that writing</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">and reading one block of logical block size bytes is atomic, and we can read and write</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">different blocks from different hosts at the same time.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">The relevant code validating PV block sizes is here:</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default"><font color="#000000">    <a href="https://github.com/oVirt/vdsm/blob/8b043e402f41d8a82b9f832be5f582b8520b38bc/lib/vdsm/storage/lvm.py#L1110">https://github.com/oVirt/vdsm/blob/8b043e402f41d8a82b9f832be5f582b8520b38bc/lib/vdsm/storage/lvm.py#L1110</a></font><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Reading the comments in bug 732980, I don't see anything about physical block size. It looks</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">like this is unnecessary check, and we should check only the logical block size.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Regarding mixing devices with different logical block size, according to</div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000">    <a href="https://bugzilla.redhat.com/show_bug.cgi?id=732980#c8">https://bugzilla.redhat.com/show_bug.cgi?id=732980#c8</a></font><br></div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000">We should not extend an LV over devices with different block size, as this will change the device</font></div><div class="gmail_default"><font color="#000000">logical block size (e.g change from 512 to 4k), and the change may break the upper layer that</font></div><div class="gmail_default"><font color="#000000">already use the device and assume the previous logical block size.</font></div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000">Based on this, I think we are ok with limiting VG to devices with same logical block size, so any </font></div><div class="gmail_default"><font color="#000000">LV can be extended to any device.</font></div><div class="gmail_default"><br></div><div class="gmail_default">I think this code should change to:</div><div class="gmail_default"><br></div><div class="gmail_default">1. When creating a VG, check that all PVs use the same logical block size</div><div class="gmail_default">2. Store the logical block size in the VG tag</div><div class="gmail_default">3. When extending the VG, check that the new PVs use the same logical block size</div><div class="gmail_default">4. When starting to use a VG, check that stored logical block size matches PVs logical block size</div><div class="gmail_default"><br></div><div class="gmail_default">What do you think?</div><div class="gmail_default"><br></div><div class="gmail_default">Nir</div><div class="gmail_default"><br></div></div></div></div></div></div>