int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
struct obd_ioobj *obj, int niocount,
- struct niobuf_local *res, struct obd_trans_info *oti)
+ struct niobuf_local *res, struct obd_trans_info *oti,
+ int rc)
{
struct obd_device *obd = exp->exp_obd;
struct obd_run_ctxt saved;
struct fsfilt_objinfo fso;
struct iattr iattr = { .ia_valid = ATTR_SIZE, .ia_size = 0, };
struct inode *inode = NULL;
- int rc = 0, i, k, cleanup_phase = 0, err;
+ int i, k, cleanup_phase = 0, err;
unsigned long now = jiffies; /* DEBUGGING OST TIMEOUTS */
int blocks_per_page;
- struct dio_request *dreq;
+ struct dio_request *dreq = NULL;
struct bio *bio = NULL;
ENTRY;
LASSERT(oti != NULL);
LASSERT(objcount == 1);
LASSERT(current->journal_info == NULL);
+ if (rc != 0)
+ GOTO(cleanup, rc);
+
inode = res->dentry->d_inode;
blocks_per_page = PAGE_SIZE >> inode->i_blkbits;
LASSERT(blocks_per_page <= MAX_BLOCKS_PER_PAGE);
push_ctxt(&saved, &obd->obd_ctxt, NULL);
cleanup_phase = 2;
- oti->oti_handle = fsfilt_brw_start(obd, objcount, &fso, niocount, oti);
+ oti->oti_handle = fsfilt_brw_start(obd, objcount, &fso, niocount, res, oti);
if (IS_ERR(oti->oti_handle)) {
rc = PTR_ERR(oti->oti_handle);
CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR,
submit_bio(WRITE, bio);
}
- filter_grant_commit(exp, niocount, res);
-
/* time to wait for I/O completion */
wait_event(dreq->wait, atomic_read(&dreq->numreqs) == 0);
CERROR("slow commitrw commit %lus\n", (jiffies - now) / HZ);
cleanup:
+ filter_grant_commit(exp, niocount, res);
+
switch (cleanup_phase) {
case 2:
pop_ctxt(&saved, &obd->obd_ctxt, NULL);