Switching size of transaction credits counters from uchar to
ushort to avoid possible overflow scenarios, like when
wide-striping.
Also allow OSD_TRACK_DECLARES to be undefined without
compile-time errors for unsatisfied-externals/unused vars.
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I2588cf11741ca4e3ee80b795a7d4318f9ed4fd3d
Reviewed-on: http://review.whamcloud.com/5830
Tested-by: Hudson
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
CFS_INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
CFS_INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
- memset(oti->oti_declare_ops, 0, OSD_OT_MAX);
- memset(oti->oti_declare_ops_rb, 0, OSD_OT_MAX);
- memset(oti->oti_declare_ops_cred, 0, OSD_OT_MAX);
+#ifdef OSD_TRACK_DECLARES
+ memset(oti->oti_declare_ops, 0,
+ sizeof(oti->oti_declare_ops));
+ memset(oti->oti_declare_ops_rb, 0,
+ sizeof(oti->oti_declare_ops_rb));
+ memset(oti->oti_declare_ops_cred, 0,
+ sizeof(oti->oti_declare_ops_cred));
oti->oti_rollback = false;
oti->oti_rollback = false;
GOTO(out, rc);
if (unlikely(osd_param_is_not_sane(dev, th))) {
GOTO(out, rc);
if (unlikely(osd_param_is_not_sane(dev, th))) {
+#ifdef OSD_TRACK_DECLARES
static unsigned long last_printed;
static int last_credits;
static unsigned long last_printed;
static int last_credits;
CWARN("%.16s: too many transaction credits (%d > %d)\n",
LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name,
CWARN("%.16s: too many transaction credits (%d > %d)\n",
LDISKFS_SB(osd_sb(dev))->s_es->s_volume_name,
/* Tracking for transaction credits, to allow debugging and optimizing
* cases where a large number of credits are being allocated for
* single transaction. */
/* Tracking for transaction credits, to allow debugging and optimizing
* cases where a large number of credits are being allocated for
* single transaction. */
- unsigned char oti_declare_ops[OSD_OT_MAX];
- unsigned char oti_declare_ops_rb[OSD_OT_MAX];
+ unsigned short oti_declare_ops[OSD_OT_MAX];
+ unsigned short oti_declare_ops_rb[OSD_OT_MAX];
unsigned short oti_declare_ops_cred[OSD_OT_MAX];
bool oti_rollback;
#endif
unsigned short oti_declare_ops_cred[OSD_OT_MAX];
bool oti_rollback;
#endif