Originally for bug 1684, later found to be caused by stack overflows.
int nblocks = EXT3_DATA_TRANS_BLOCKS;
void *handle;
+ LASSERT(current->journal_info == NULL);
+
switch(op) {
case FSFILT_OP_CREATE_LOG:
nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS+EXT3_DATA_TRANS_BLOCKS;
handle = journal_start(EXT3_JOURNAL(inode), nblocks);
unlock_kernel();
+ if (!IS_ERR(handle))
+ LASSERT(current->journal_info == handle);
return handle;
}
lock_kernel();
handle = journal_start(journal, needed);
unlock_kernel();
- if (IS_ERR(handle))
+ if (IS_ERR(handle)) {
CERROR("can't get handle for %d credits: rc = %ld\n", needed,
PTR_ERR(handle));
- else
+ } else {
LASSERT(handle->h_buffer_credits >= needed);
+ LASSERT(current->journal_info == handle);
+ }
RETURN(handle);
}
int rc;
handle_t *handle = h;
+ LASSERT(current->journal_info == handle);
if (force_sync)
handle->h_sync = 1; /* recovery likes this */
rc = journal_stop(handle);
unlock_kernel();
+ LASSERT(current->journal_info == NULL);
return rc;
}
int nblocks = EXTN_DATA_TRANS_BLOCKS;
void *handle;
+ LASSERT(current->journal_info == NULL);
+
switch(op) {
case FSFILT_OP_CREATE_LOG:
nblocks += EXTN_INDEX_EXTRA_TRANS_BLOCKS+EXTN_DATA_TRANS_BLOCKS;
handle = journal_start(EXTN_JOURNAL(inode), nblocks);
unlock_kernel();
+ if (!IS_ERR(handle))
+ LASSERT(current->journal_info == handle);
return handle;
}
lock_kernel();
handle = journal_start(journal, needed);
unlock_kernel();
- if (IS_ERR(handle))
+ if (IS_ERR(handle)) {
CERROR("can't get handle for %d credits: rc = %ld\n", needed,
PTR_ERR(handle));
- else
+ } else {
LASSERT(handle->h_buffer_credits >= needed);
+ LASSERT(current->journal_info == handle);
+ }
RETURN(handle);
}
int rc;
handle_t *handle = h;
+ LASSERT(current->journal_info == handle);
if (force_sync)
handle->h_sync = 1; /* recovery likes this */
rc = journal_stop(handle);
unlock_kernel();
+ LASSERT(current->journal_info == NULL);
return rc;
}
int rc, rc2, cleanup_phase = 0;
struct dentry *dparent = NULL;
struct obd_run_ctxt saved;
+ int nested_trans = (current->journal_info != NULL);
ENTRY;
LASSERT(filp->private_data == ffd);
if (!rc)
rc = rc2;
}
+ if (nested_trans == 0) {
+ LASSERT(current->journal_info == NULL);
+ if (oti != NULL)
+ oti->oti_handle = NULL;
+ }
}
cleanup:
ENTRY;
LASSERT(objcount == 1);
+ /* We should never be called during a transaction */
+ LASSERT(oti != NULL);
+ LASSERT(oti->oti_handle == NULL);
+ LASSERT(current->journal_info == NULL);
+
OBD_ALLOC(fso, objcount * sizeof(*fso));
if (fso == NULL)
RETURN(-ENOMEM);
if (time_after(jiffies, now + 15 * HZ))
CERROR("slow prep setup %lus\n", (jiffies - now) / HZ);
- LASSERT(oti != NULL);
oti->oti_handle = fsfilt_brw_start(exp->exp_obd, objcount, fso,
niocount, oti);
if (IS_ERR(oti->oti_handle)) {
fsfilt_commit(exp->exp_obd,
filter_parent(exp->exp_obd,S_IFREG,obj->ioo_id)->d_inode,
oti->oti_handle, 0);
+ LASSERT(current->journal_info == NULL);
+ oti->oti_handle = NULL;
goto out; /* dropped the dentry refs already (one per page) */
out_objinfo:
struct niobuf_local *lnb;
struct obd_device *obd = exp->exp_obd;
int found_locked = 0, rc = 0, i;
- int nested_trans = current->journal_info != NULL;
unsigned long now = jiffies; /* DEBUGGING OST TIMEOUTS */
ENTRY;
push_ctxt(&saved, &obd->u.filter.fo_ctxt, NULL);
+ LASSERT(current->journal_info == NULL);
if (cmd & OBD_BRW_WRITE) {
- LASSERT(oti);
- LASSERT(current->journal_info == NULL ||
- current->journal_info == oti->oti_handle);
+ LASSERT(oti != NULL);
+ LASSERT(oti->oti_handle != NULL);
current->journal_info = oti->oti_handle;
}
rc = filter_finish_transno(exp, oti, rc);
err = fsfilt_commit(obd, dparent->d_inode, oti->oti_handle,
obd_sync_filter);
+ LASSERT(current->journal_info == NULL);
+ oti->oti_handle = NULL;
if (err)
rc = err;
if (obd_sync_filter)
CERROR("slow commitrw commit %lus\n", (jiffies-now)/HZ);
}
- LASSERT(nested_trans || current->journal_info == NULL);
pop_ctxt(&saved, &obd->u.filter.fo_ctxt, NULL);
RETURN(rc);
}
int should_process, fail = OBD_FAIL_OST_ALL_REPLY_NET, rc = 0;
ENTRY;
+ LASSERT(current->journal_info == NULL);
/* XXX identical to MDS */
if (req->rq_reqmsg->opc != OST_CONNECT) {
struct obd_device *obd;
CDEBUG(D_INODE, "write\n");
OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
rc = ost_brw_write(req, oti);
+ LASSERT(current->journal_info == NULL);
/* ost_brw sends its own replies */
RETURN(rc);
case OST_READ:
CDEBUG(D_INODE, "read\n");
OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
rc = ost_brw_read(req);
+ LASSERT(current->journal_info == NULL);
/* ost_brw sends its own replies */
RETURN(rc);
case OST_SAN_READ:
RETURN(rc);
}
+ LASSERT(current->journal_info == NULL);
+
EXIT;
/* If we're DISCONNECTing, the export_data is already freed */
if (!rc && req->rq_reqmsg->opc != OST_DISCONNECT) {