Whamcloud - gitweb
LU-2191 utils: tunefs.lustre failed to read ZFS partitions
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Mon, 5 Nov 2012 21:07:55 +0000 (16:07 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 7 Nov 2012 02:55:52 +0000 (21:55 -0500)
ZFS shared libraries were not loaded prior to attempting to verify
type of partition supplied on commandline, it would never recognize a
ZFS partition.  Mount type also needs to be passed down to
osd_read_lld, and not just use whatever is set in defaults.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Iad88da4ddd9cf5fcc75f8409933467d9237f58d3
Reviewed-on: http://review.whamcloud.com/4469
Tested-by: Hudson
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/utils/mkfs_lustre.c

index 2e24134..3af3a0a 100644 (file)
@@ -572,6 +572,10 @@ int main(int argc, char *const argv[])
         /* device is last arg */
         strscpy(mop.mo_device, argv[argc - 1], sizeof(mop.mo_device));
 
+       ret = osd_init();
+       if (ret)
+               return ret;
+
 #ifdef TUNEFS
         /* For tunefs, we must read in the old values before parsing any
            new ones. */
@@ -585,6 +589,7 @@ int main(int argc, char *const argv[])
                 ret = ENODEV;
                 goto out;
         }
+       mop.mo_ldd.ldd_mount_type = mount_type;
 
        ret = osd_read_ldd(mop.mo_device, &mop.mo_ldd);
         if (ret) {
@@ -602,10 +607,6 @@ int main(int argc, char *const argv[])
                 print_ldd("Read previous values", &(mop.mo_ldd));
 #endif
 
-       ret = osd_init();
-       if (ret)
-               return ret;
-
         ret = parse_opts(argc, argv, &mop, &mountopts);
         if (ret)
                 goto out;