From 37edc668a415173f6e281b46dbcb34977b556259 Mon Sep 17 00:00:00 2001 From: tianzy Date: Tue, 19 May 2009 07:46:41 +0000 Subject: [PATCH] Branch b_release_1_8_1 fix the problem of "if fsfilt_add_journal_cb() will fail, export ref will be took twice." b=19321 i=tappro i=tianzy --- lustre/mds/mds_reint.c | 5 +++-- lustre/obdfilter/filter.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index d347a7c..cb47f81 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -320,16 +320,17 @@ int mds_finish_transno(struct mds_obd *mds, struct inode **inodes, void *handle, } else { struct obd_export *exp = req->rq_export; + class_export_get(exp); /* released once the cb is called */ if (!force_sync) force_sync = fsfilt_add_journal_cb(obd, transno, handle, mds_commit_cb, - class_export_get(exp)); + exp); err = fsfilt_write_record(obd, mds->mds_rcvd_filp, lcd, sizeof(*lcd), &off, force_sync | exp->exp_need_sync); if (force_sync) - mds_commit_cb(obd, transno, class_export_get(exp), err); + mds_commit_cb(obd, transno, exp, err); } if (err) { diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 7f3c679..91d24a6 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -166,18 +166,19 @@ int filter_finish_transno(struct obd_export *exp, struct inode *inode, fed->fed_lr_idx, fed->fed_lr_off); err = -EINVAL; } else { + class_export_get(exp); /* released when the cb is called */ if (!force_sync) force_sync = fsfilt_add_journal_cb(exp->exp_obd, last_rcvd, oti->oti_handle, filter_commit_cb, - class_export_get(exp)); + exp); err = fsfilt_write_record(exp->exp_obd, filter->fo_rcvd_filp, lcd, sizeof(*lcd), &off, force_sync | exp->exp_need_sync); if (force_sync) - filter_commit_cb(exp->exp_obd, last_rcvd, class_export_get(exp), err); + filter_commit_cb(exp->exp_obd, last_rcvd, exp, err); } if (err) { log_pri = D_ERROR; -- 1.8.3.1