int retried = 0;
__u32 fst_gen;
__u32 snd_gen;
+ int steps = 0;
int fst_fl;
- int rc2;
+ int rc2 = 0;
int rc;
ENTRY;
out_restore:
if (rc != 0) {
- int steps = 0;
-
/* failure on second file, but first was done, so we have
* to roll back first.
*/
}
do_lbug:
- if (rc2 < 0) {
- /* very bad day */
- CERROR("%s: unable to roll back layout swap of "DFID" and "DFID", steps: %d: rc = %d/%d\n",
- mdd_obj_dev_name(fst_o),
- PFID(mdd_object_fid(snd_o)),
- PFID(mdd_object_fid(fst_o)),
- rc, rc2, steps);
- /* a solution to avoid journal commit is to panic,
- * but it has strong consequences so we use LBUG to
- * allow sysdamin to choose to panic or not
- */
- LBUG();
- }
+ /* very bad day - a solution to avoid journal commit
+ * is to panic, but it has strong consequences so we
+ * use LASSERT to allow sysdamin to choose to panic
+ * or not
+ */
+ LASSERTF(rc2 >= 0,
+ "%s: unable to roll back layout swap of " DFID " and " DFID ", steps: %d: rc = %d/%d\n",
+ mdd_obj_dev_name(fst_o), PFID(mdd_object_fid(snd_o)),
+ PFID(mdd_object_fid(fst_o)), rc, rc2, steps);
}
unlock:
LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC,
"obd %px obd_magic %08x != %08x\n",
obd, obd->obd_magic, OBD_DEVICE_MAGIC);
- if (obd->obd_namespace != NULL) {
- CERROR("obd %px: namespace %px was not properly cleaned up (obd_force=%d)!\n",
- obd, obd->obd_namespace, obd->obd_force);
- LBUG();
- }
+ LASSERTF(obd->obd_namespace == NULL,
+ "obd %px: namespace %px was not properly cleaned up (obd_force=%d)!\n",
+ obd, obd->obd_namespace, obd->obd_force);
OBD_SLAB_FREE_PTR(obd, obd_device_cachep);
}
void dt_los_put(struct local_oid_storage *los)
{
- if (atomic_dec_and_test(&los->los_refcount))
- /* should never happen, only local_oid_storage_fini should
- * drop refcount to zero */
- LBUG();
+ /* should never happen, only local_oid_storage_fini should
+ * drop refcount to zero
+ */
+ LASSERT(!atomic_dec_and_test(&los->los_refcount));
}
/* after Lustre 2.3 release there may be old file to store last generated FID
for (i = 0; i < ARRAY_SIZE(mps_stats); i++) {
lprocfs_counter_init(stats, i, LPROCFS_TYPE_REQS,
mps_stats[i]);
- if (!stats->ls_cnt_header[i].lc_name) {
- CERROR("Missing md_stat initializer md_op operation at offset %d. Aborting.\n",
- i);
- LBUG();
- }
+ LASSERTF(stats->ls_cnt_header[i].lc_name,
+ "Missing md_stat initializer md_op operation at offset %d. Aborting.\n",
+ i);
}
rc = lprocfs_stats_register(obd->obd_proc_entry, "md_stats", stats);
/* Clear bit when lcd is freed */
LASSERT(lut && lut->lut_client_bitmap);
- if (!test_and_clear_bit(ted->ted_lr_idx, lut->lut_client_bitmap)) {
- CERROR("%s: client %u bit already clear in bitmap\n",
- exp->exp_obd->obd_name, ted->ted_lr_idx);
- LBUG();
- }
+ LASSERTF(test_and_clear_bit(ted->ted_lr_idx, lut->lut_client_bitmap),
+ "%s: client %u bit already clear in bitmap\n",
+ exp->exp_obd->obd_name, ted->ted_lr_idx);
}
EXPORT_SYMBOL(tgt_client_free);
exp_connect_flags(exp) & OBD_CONNECT_LIGHTWEIGHT)
RETURN(0);
- if (test_and_set_bit(idx, tgt->lut_client_bitmap)) {
- CERROR("%s: client %d: bit already set in bitmap!!\n",
- tgt->lut_obd->obd_name, idx);
- LBUG();
- }
+ LASSERTF(!test_and_set_bit(idx, tgt->lut_client_bitmap),
+ "%s: client %d: bit already set in bitmap!!\n",
+ tgt->lut_obd->obd_name, idx);
CDEBUG(D_INFO, "%s: client at idx %d with UUID '%s' added, "
"generation %d\n",
/* Clear the bit _after_ zeroing out the client so we don't
race with filter_client_add and zero out new clients.*/
- if (!test_bit(ted->ted_lr_idx, tgt->lut_client_bitmap)) {
- CERROR("%s: client %u: bit already clear in bitmap!!\n",
- tgt->lut_obd->obd_name, ted->ted_lr_idx);
- LBUG();
- }
+ LASSERTF(test_bit(ted->ted_lr_idx, tgt->lut_client_bitmap),
+ "%s: client %u: bit already clear in bitmap!!\n",
+ tgt->lut_obd->obd_name, ted->ted_lr_idx);
/* Do not erase record for recoverable client. */
if (exp->exp_flags & OBD_OPT_FAILOVER)