To preserve the ability to down-grade from 0.7.x to 0.6.x,
don't auto-upgrade quotas.
Print warning if quotas haven't been upgraded when mouting with 0.7.0.
Do check based on zpool feature in sanity-quota instead of just
version.
Lustre-change: https://review.whamcloud.com/#/c/28924/
Lustre-commit:
0bbef0afc16081e1af3529642436864954a73e3c
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I2b0dcba3a230c9b2dec3d07d1b4ca6f1a1717d47
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28954
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
GOTO(err, rc);
}
+#ifdef HAVE_DMU_USEROBJ_ACCOUNTING
+ if (!osd_dmu_userobj_accounting_available(o))
+ CWARN("%s: dnode accounting not enabled: "
+ "enable feature@userobj_accounting in pool\n",
+ o->od_mntdev);
+#endif
+
/* parse mount option "noacl", and enable ACL by default */
opts = lustre_cfg_string(cfg, 3);
if (opts == NULL || strstr(opts, "noacl") == NULL)
static inline bool osd_dmu_userobj_accounting_available(struct osd_device *osd)
{
- if (unlikely(dmu_objset_userobjspace_upgradable(osd->od_os)))
- dmu_objset_userobjspace_upgrade(osd->od_os);
-
return dmu_objset_userobjspace_present(osd->od_os);
}
#else
# LU-2435: skip this quota test if underlying zfs version has not
# supported native dnode accounting
[ "$(facet_fstype mds1)" == "zfs" ] && {
- local zfs_version=$(do_facet mds1 cat /sys/module/zfs/version)
+ local F="feature@userobj_accounting"
+ local pool=$(zpool_name mds1)
+ local feature=$(do_facet mds1 $ZPOOL get -H $F $pool)
- [ $(version_code $zfs_version) -lt $(version_code 0.7.0) ] &&
- skip "requires zfs version at least 0.7.0" && return
+ [[ "$feature" != *" active "* ]] &&
+ skip "requires zpool with active userobj_accounting" &&
+ return
}
local ilimit=$((1024 * 2)) # 2k inodes
php = zpool_open(g_zfs, pool);
if (php) {
pool_exists = 1;
+ zpool_set_prop(php, "canmount", "off");
zpool_close(php);
}
/*
* Set Options on ZPOOL
*
- * ALL - canmount=off
+ * ALL - canmount=off (set above)
* 0.7.0 - multihost=on
+ * 0.7.0 - feature@userobj_accounting=enabled
*/
php = zpool_open(g_zfs, pool);
if (php) {
- if (pool_exists)
- zpool_set_prop(php, "canmount", "off");
-
zpool_set_prop(php, "multihost", "on");
+ zpool_set_prop(php, "feature@userobj_accounting", "enabled");
zpool_close(php);
}