int tgd_tot_granted_clients;
/* shall we grant space to clients not
* supporting OBD_CONNECT_GRANT_PARAM? */
- unsigned int tgd_grant_compat_disable:1,
- /* if 1 then LBUG on grant miscount, CERROR otherwise */
- tgd_lbug_on_grant_miscount:1;
+ int tgd_grant_compat_disable;
/* protect all statfs-related counters */
spinlock_t tgd_osfs_lock;
time64_t tgd_osfs_age;
ssize_t grant_compat_disable_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer, size_t count);
-ssize_t lbug_on_grant_miscount_show(struct kobject *kobj,
- struct attribute *attr, char *buf);
-ssize_t lbug_on_grant_miscount_store(struct kobject *kobj,
- struct attribute *attr,
- const char *buffer, size_t count);
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
ssize_t sync_lock_cancel_show(struct kobject *kobj,
struct attribute *attr, char *buf);
LUSTRE_RO_ATTR(tot_granted);
LUSTRE_RO_ATTR(tot_pending);
LUSTRE_RW_ATTR(grant_compat_disable);
-LUSTRE_RW_ATTR(lbug_on_grant_miscount);
LUSTRE_RO_ATTR(instance);
LUSTRE_RO_ATTR(num_exports);
&lustre_attr_tot_granted.attr,
&lustre_attr_tot_pending.attr,
&lustre_attr_grant_compat_disable.attr,
- &lustre_attr_lbug_on_grant_miscount.attr,
&lustre_attr_instance.attr,
&lustre_attr_recovery_time_hard.attr,
&lustre_attr_recovery_time_soft.attr,
LUSTRE_RO_ATTR(tot_granted);
LUSTRE_RO_ATTR(tot_pending);
LUSTRE_RW_ATTR(grant_compat_disable);
-LUSTRE_RW_ATTR(lbug_on_grant_miscount);
LUSTRE_RO_ATTR(instance);
LUSTRE_RO_ATTR(num_exports);
&lustre_attr_tot_granted.attr,
&lustre_attr_tot_pending.attr,
&lustre_attr_grant_compat_disable.attr,
- &lustre_attr_lbug_on_grant_miscount.attr,
&lustre_attr_instance.attr,
&lustre_attr_recovery_time_hard.attr,
&lustre_attr_recovery_time_soft.attr,
#include "tgt_internal.h"
+int lbug_on_grant_miscount;
+module_param(lbug_on_grant_miscount, int, 0644);
+MODULE_PARM_DESC(lbug_on_grant_miscount, "LBUG on grant miscount");
+
/* Clients typically hold 2x their max_rpcs_in_flight of grant space */
#define TGT_GRANT_SHRINK_LIMIT(exp) (2ULL * 8 * exp_max_brw_size(exp))
CERROR("%s: cli %s/%p grant %ld want %llu current %llu\n",
obd->obd_name, exp->exp_client_uuid.uuid, exp,
ted->ted_grant, want, curgrant);
- spin_unlock(&tgd->tgd_grant_lock);
- if (tgd->tgd_lbug_on_grant_miscount)
+ if (lbug_on_grant_miscount) {
+ spin_unlock(&tgd->tgd_grant_lock);
LBUG();
+ }
}
CDEBUG(D_CACHE,
return count;
}
EXPORT_SYMBOL(grant_compat_disable_store);
-
-/**
- * Show lbug_on_grant_miscount mode.
- *
- * @kobj kobject embedded in obd_device
- * @attr unused
- * @buf buf used by sysfs to print out data
- *
- * Return: string length of @buf output on success
- */
-ssize_t lbug_on_grant_miscount_show(struct kobject *kobj,
- struct attribute *attr, char *buf)
-{
- struct obd_device *obd = container_of(kobj, struct obd_device,
- obd_kset.kobj);
- struct tg_grants_data *tgd = &obd->u.obt.obt_lut->lut_tgd;
-
- return scnprintf(buf, PAGE_SIZE, "%u\n",
- tgd->tgd_lbug_on_grant_miscount);
-}
-EXPORT_SYMBOL(lbug_on_grant_miscount_show);
-
-/**
- * Change lbug on grant miscount mode.
- *
- * Setting tgd_lbug_on_grant_miscount to 1 makes tgt_alloc_grant() to
- * LBUG on apparently wrong ted->ted_grant
- *
- * @kobj kobject embedded in obd_device
- * @attr unused
- * @buffer string which represents mode
- * 1: use LBUG on grant miscount
- * 0: use CERROR on grant miscount
- * @count @buffer length
- *
- * Return: @count on success
- * negative number on error
- */
-ssize_t lbug_on_grant_miscount_store(struct kobject *kobj,
- struct attribute *attr,
- const char *buffer, size_t count)
-{
- struct obd_device *obd = container_of(kobj, struct obd_device,
- obd_kset.kobj);
- struct tg_grants_data *tgd = &obd->u.obt.obt_lut->lut_tgd;
- bool val;
- int rc;
-
- rc = kstrtobool(buffer, &val);
- if (rc)
- return rc;
-
- tgd->tgd_lbug_on_grant_miscount = val;
-
- return count;
-}
-EXPORT_SYMBOL(lbug_on_grant_miscount_store);
tgd->tgd_tot_granted = 0;
tgd->tgd_tot_pending = 0;
tgd->tgd_grant_compat_disable = 0;
- tgd->tgd_lbug_on_grant_miscount = 0;
/* populate cached statfs data */
osfs = &tgt_th_info(env)->tti_u.osfs;
fi
load_module ../lnet/klnds/$LNETLND
load_module obdclass/obdclass
+ MODOPTS_PTLRPC=${MODOPTS_PTLRPC:-"lbug_on_grant_miscount=1"}
load_module ptlrpc/ptlrpc
load_module ptlrpc/gss/ptlrpc_gss
load_module fld/fld
(( MDS1_VERSION <= $(version_code 2.13.52) )) ||
do_nodes $(comma_list $(mdts_nodes)) \
"$LCTL set_param lod.*.mdt_hash=crush"
- do_node $(mgs_node) "$LCTL set_param -P *.*.lbug_on_grant_miscount=1"
return 0
}