Hello Manoj Pillai, Timothy Asir, Bala.FA, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/50849

to review the following change.

Change subject: gluster: fix xfs filesystem is created with wrong inode size
......................................................................

gluster: fix xfs filesystem is created with wrong inode size

Currently brick create function creates an xfs filesystem with
inode size of 256 for brick which uses raid0 or JBOD devices.

This patch uses the striping parameters "-d su=stripe_unit_size,
sw=stripe_width_in_number_of_disks" during xfs file system
create for RAID6. For RAID 10, JBOD and other devices it omits
the "-d su=<>,sw=<>" option and set only the inode size to 512
and the directory block size to 8192.

Change-Id: If3f350d2f79172705a93a9d69fe1b7b78867861e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1244865
Signed-off-by: Timothy Asir Jeyasingh <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/43847
Reviewed-by: Bala.FA <[email protected]>
Reviewed-by: Manoj Pillai <[email protected]>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/gluster/storagedev.py
1 file changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/50849/1

diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index af250417..1e4402c 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -268,13 +268,16 @@
     blivetEnv = blivet.Blivet()
     _reset_blivet(blivetEnv)
 
+    # get the devices list from the device name
     deviceList = _getDeviceList(devNameList)
 
+    # raise an error when any device not actually found in the given list
     notFoundList = set(devNameList).difference(
         set([dev.name for dev in deviceList]))
     if notFoundList:
         raise ge.GlusterHostStorageDeviceNotFoundException(notFoundList)
 
+    # raise an error when any device is used already in the given list
     inUseList = set(devNameList).difference(set([not _canCreateBrick(
         dev) or dev.name for dev in deviceList]))
     if inUseList:
@@ -288,6 +291,11 @@
     # http://docbuilder.usersys.redhat.com/22522
     # /#chap-Configuring_Red_Hat_Storage_for_Enhancing_Performance
 
+    # create ~16GB metadata LV (metaDataSize) that has a size which is
+    # a multiple of RAID stripe width if it is > minimum vg size
+    # otherwise allocate a minimum of 0.5% of the data device size
+    # and create data LV (poolDataSize) that has a size which is
+    # a multiple of stripe width
     if alignment:
         vgSizeKib = int(vg.size.convertTo(spec="KiB"))
         if vg.size.convertTo(spec='MiB') < MIN_VG_SIZE:
@@ -296,6 +304,9 @@
         metaDataSize = (metaDataSize - (metaDataSize % alignment))
         poolDataSize = (poolDataSize - (poolDataSize % alignment))
 
+    # Creating a thin pool from the data LV and the metadata LV
+    # lvconvert --chunksize alignment --thinpool VOLGROUP/thin_pool
+    #     --poolmetadata VOLGROUP/metadata_device_name
     pool = _createThinPool(poolName, vg, chunkSize, metaDataSize, poolDataSize)
     thinlv = LVMThinLogicalVolumeDevice(brickName, parents=[pool],
                                         size=pool.size, grow=True)
@@ -308,11 +319,10 @@
             thinlv.path, alignment, raidParams.get('stripeSize', 0), fsType)
 
     format = blivet.formats.getFormat(DEFAULT_FS_TYPE, device=thinlv.path)
-    if alignment:
-        format._defaultFormatOptions = [
-            "-f", "-K", "-i", "size=512",
-            "-d", "sw=%s,su=%sk" % (count, raidParams.get('stripeSize')),
-            "-n", "size=8192"]
+    format._defaultFormatOptions = ["-f", "-i", "size=512", "-n", "size=8192"]
+    if raidParams.get('type') == '6':
+        format._defaultFormatOptions += ["-d", "sw=%s,su=%sk" % (
+            count, raidParams.get('stripeSize'))]
     blivetEnv.formatDevice(thinlv, format)
     blivetEnv.doIt()
 


-- 
To view, visit https://gerrit.ovirt.org/50849
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3f350d2f79172705a93a9d69fe1b7b78867861e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Ramesh N <[email protected]>
Gerrit-Reviewer: Bala.FA <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Manoj Pillai <[email protected]>
Gerrit-Reviewer: Timothy Asir <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to