Whamcloud - gitweb
LU-8443 utils: exclude "resize" parameter with meta_bg option 45/21545/5
authorArtem Blagodarenko <artem.blagodarenko@seagate.com>
Wed, 27 Jul 2016 15:05:58 +0000 (18:05 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 2 Sep 2016 02:22:57 +0000 (02:22 +0000)
Partitions with size > 256TB must use meta_bg option. This option
is not compatible with "resize_inode" option and "resize" extended
option. For optimization reason "resize" option is enabled by
default. For filesystems with < 2^32 blocks this optimization is
useless.

This patch disables resize option if meta_bg is enabled. The test
that formats Lustre FS with "^resize_inode,meta_bg" options on OST
added.

Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com>
Seagate-bug-id: MRP-3647
Change-Id: Ibea2d18f79498636a165a682cf6b6435f7cebfba
Reviewed-on: http://review.whamcloud.com/21545
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/conf-sanity.sh
lustre/utils/mount_utils_ldiskfs.c

index c64ebab..2162a5b 100755 (executable)
@@ -6796,6 +6796,37 @@ test_97() {
 }
 run_test 97 "ldev returns correct ouput when querying based on role"
 
 }
 run_test 97 "ldev returns correct ouput when querying based on role"
 
+test_99()
+{
+       [[ $(facet_fstype ost1) != ldiskfs ]] &&
+               { skip "Only applicable to ldiskfs-based OSTs" && return; }
+
+       local ost_opts="$(mkfs_opts ost1 $(ostdevname 1)) \
+               --reformat $(ostdevname 1) $(ostvdevname 1)"
+       do_facet ost1 $DEBUGFS -c -R stats `ostdevname 1` | grep "meta_bg" &&
+               skip "meta_bg already set" && return
+
+       local opts=ost_opts
+       if [[ ${!opts} != *mkfsoptions* ]]; then
+               eval opts=\"${!opts} \
+               --mkfsoptions='\\\"-O ^resize_inode,meta_bg\\\"'\"
+       else
+               local val=${!opts//--mkfsoptions=\\\"/ \
+               --mkfsoptions=\\\"-O ^resize_inode,meta_bg }
+               eval opts='${val}'
+       fi
+
+       echo "params: $opts"
+
+       add ost1 $opts || error "add ost1 failed with new params"
+
+       do_facet ost1 $DEBUGFS -c -R stats `ostdevname 1` | grep "meta_bg" ||
+               error "meta_bg is not set"
+
+       return 0
+}
+run_test 99 "Adding meta_bg option"
+
 if ! combined_mgs_mds ; then
        stop mgs
 fi
 if ! combined_mgs_mds ; then
        stop mgs
 fi
index 3e50ae7..9576e66 100644 (file)
@@ -889,7 +889,8 @@ int ldiskfs_make_lustre(struct mkfs_opts *mop)
                 * descriptor blocks, but leave one block for the superblock.
                 * Only useful for filesystems with < 2^32 blocks due to resize
                 * limitations. */
                 * descriptor blocks, but leave one block for the superblock.
                 * Only useful for filesystems with < 2^32 blocks due to resize
                 * limitations. */
-               if (IS_OST(&mop->mo_ldd) && mop->mo_device_kb > 100 * 1024 &&
+               if (strstr(mop->mo_mkfsopts, "meta_bg") == NULL &&
+                   IS_OST(&mop->mo_ldd) && mop->mo_device_kb > 100 * 1024 &&
                    mop->mo_device_kb * 1024 / L_BLOCK_SIZE <= 0xffffffffULL) {
                        unsigned group_blocks = L_BLOCK_SIZE * 8;
                        unsigned desc_per_block = L_BLOCK_SIZE / 32;
                    mop->mo_device_kb * 1024 / L_BLOCK_SIZE <= 0xffffffffULL) {
                        unsigned group_blocks = L_BLOCK_SIZE * 8;
                        unsigned desc_per_block = L_BLOCK_SIZE / 32;