#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */
#define PARAM_ROOTSQUASH "root_squash=" /* root squash */
#define PARAM_NOSQUASHNIDS "nosquash_nids=" /* no squash nids */
+#define PARAM_AUTODEGRADE "autodegrade=" /* autodegrade OST's */
/* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */
#define PARAM_OST "ost."
GOTO(end, rc);
}
+ /* For handling degraded zfs OST */
+ if (class_match_param(ptr, PARAM_AUTODEGRADE, NULL) == 0)
+ GOTO(end, rc);
+
LCONSOLE_WARN("Ignoring unrecognized param '%s'\n", ptr);
end:
local dataset="$1"
local state="$2"
local service=$($ZFS list -H -o lustre:svname ${dataset})
-
- zed_log_msg "Lustre:sync_degrade_state pool:${dataset} degraded:${state}"
+ local autodegrade=$($ZFS get -rH -s local -t filesystem -o value \
+ lustre:autodegrade ${dataset})
if [ -n "${service}" ] && [ "${service}" != "-" ] ; then
local current=$($LCTL get_param -n obdfilter.${service}.degraded)
- if [ "${current}" != "${state}" ] ; then
+ if [ "${current}" != "${state}" ] &&
+ [ "${autodegrade}" == "on" ] ; then
$LCTL set_param obdfilter.${service}.degraded=${state}
+ ds_state="pool:${dataset} degraded:${state}"
+ zed_log_msg "Lustre:sync_degrade_state $ds_state"
fi
fi
}
}
}
+ if (ldd->ldd_mount_type == LDD_MT_ZFS &&
+ (ldd->ldd_flags & LDD_F_SV_TYPE_OST)) {
+ rc = add_param(ldd->ldd_params, PARAM_AUTODEGRADE, "on");
+ if (rc)
+ return rc;
+ }
+
if (strlen(new_fsname) > 0) {
if (!(mop->mo_flags & (MO_FORCEFORMAT | MO_RENAME)) &&
(!(ldd->ldd_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF)))) {