Whamcloud - gitweb
LU-17662 osd-zfs: Support for ZFS 2.2.3
[fs/lustre-release.git] / lustre / utils / libmount_utils_ldiskfs.c
index a48cadb..1721bf9 100644 (file)
@@ -416,7 +416,7 @@ static bool is_e2fsprogs_feature_supp(const char *feature)
 
        close(fd);
 
-       snprintf(cmd, sizeof(cmd), "%s -F %s %s 100 >/dev/null 2>&1",
+       snprintf(cmd, sizeof(cmd), "%s -F %s %s 200 >/dev/null 2>&1",
                 MKE2FS, feature, imgname);
        /* run_command() displays the output of mke2fs when it fails for
         * some feature, so use system() directly */
@@ -515,8 +515,6 @@ static int enable_default_ext4_features(struct mkfs_opts *mop, char *anchor,
 
        if (enable_64bit) {
                append_unique(anchor, ",", "64bit", NULL, maxbuflen);
-               if (is_e2fsprogs_feature_supp("-O meta_bg"))
-                       append_unique(anchor, ",", "meta_bg", NULL, maxbuflen);
                append_unique(anchor, ",", "^resize_inode", NULL, maxbuflen);
        }
 
@@ -867,25 +865,33 @@ int ldiskfs_make_lustre(struct mkfs_opts *mop)
                unsigned int group_blocks = mop->mo_blocksize_kb * 8192;
                unsigned int desc_per_block = mop->mo_blocksize_kb * 1024 / 32;
                unsigned int resize_blks;
+               __u64 block_count = mop->mo_device_kb / mop->mo_blocksize_kb;
 
                resize_blks = (1ULL<<32) - desc_per_block*group_blocks;
-               snprintf(buf, sizeof(buf), "%u", resize_blks);
-               append_unique(start, ext_opts ? "," : " -E ",
-                             "resize", buf, maxbuflen);
-               ext_opts = 1;
+               if (resize_blks > block_count) {
+                       snprintf(buf, sizeof(buf), "%u", resize_blks);
+                       append_unique(start, ext_opts ? "," : " -E ",
+                                     "resize", buf, maxbuflen);
+                       ext_opts = 1;
+               }
        }
 
        /* Avoid zeroing out the full journal - speeds up mkfs */
-       if (is_e2fsprogs_feature_supp("-E lazy_journal_init=0")) {
+       if (is_e2fsprogs_feature_supp("-E lazy_journal_init")) {
                append_unique(start, ext_opts ? "," : " -E ",
-                             "lazy_journal_init", "0", maxbuflen);
+                             "lazy_journal_init", NULL, maxbuflen);
                ext_opts = 1;
        }
        if (is_e2fsprogs_feature_supp("-E lazy_itable_init=0")) {
-               append_unique(start, ext_opts ? "," : "-E",
+               append_unique(start, ext_opts ? "," : " -E ",
                            "lazy_itable_init", "0", maxbuflen);
                ext_opts = 1;
        }
+       if (is_e2fsprogs_feature_supp("-E packed_meta_blocks")) {
+               append_unique(start, ext_opts ? "," : " -E ",
+                             "packed_meta_blocks", NULL, maxbuflen);
+               ext_opts = 1;
+       }
 
        /* end handle -E mkfs options */