From: Nathaniel Clark Date: Mon, 5 Nov 2012 21:07:55 +0000 (-0500) Subject: LU-2191 utils: tunefs.lustre failed to read ZFS partitions X-Git-Tag: 2.3.55~23 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9dbbf2761509ae814d25e88e527680c3e5e1c36a;ds=sidebyside LU-2191 utils: tunefs.lustre failed to read ZFS partitions 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 Change-Id: Iad88da4ddd9cf5fcc75f8409933467d9237f58d3 Reviewed-on: http://review.whamcloud.com/4469 Tested-by: Hudson Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alex Zhuravlev --- diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 2e24134..3af3a0a 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -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;