From f64a4508cdbf5af6c90977b7ab3bf9f103489236 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Fri, 14 Jul 2017 13:39:10 -0400 Subject: [PATCH] LU-9772 utils: Enable new ZFS MMP on mkfs ZFS 0.7.0 come with new multi-modifier protection, this patch enables it by default, on mkfs. This also ensures canmount is off for pools that were not just created. Signed-off-by: Nathaniel Clark Change-Id: If9b87e9786e0eaefe5ac9a536edcdca3d1012585 Reviewed-on: https://review.whamcloud.com/28051 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: Oleg Drokin (cherry picked from commit 25e1cea871abd3c08dffb06ea62046ad84a822c1) Reviewed-on: https://review.whamcloud.com/28652 --- lustre/utils/mount_utils_zfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lustre/utils/mount_utils_zfs.c b/lustre/utils/mount_utils_zfs.c index 6b33101..aacf076 100644 --- a/lustre/utils/mount_utils_zfs.c +++ b/lustre/utils/mount_utils_zfs.c @@ -697,6 +697,22 @@ int zfs_make_lustre(struct mkfs_opts *mop) } /* + * Set Options on ZPOOL + * + * ALL - canmount=off + * 0.7.0 - multihost=on + */ + php = zpool_open(g_zfs, pool); + if (php) { + if (pool_exists) + zpool_set_prop(php, "canmount", "off"); + + zpool_set_prop(php, "multihost", "on"); + + zpool_close(php); + } + + /* * Create the ZFS filesystem with any required mkfs options: * - canmount=off is set to prevent zfs automounting * - xattr=sa is set to use system attribute based xattrs -- 1.8.3.1