X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Fquota_ctl.c;h=ad4f9a40cba808ca46bb5696bb0ff9b57e8d9e6b;hb=a328a628aaab22311020dff7bd99a369aa867124;hp=5e8cd88806c974e1588b910255364dea817a4789;hpb=bc60e9e0608e0afbda9e1439bf98730a83a5bb87;p=fs%2Flustre-release.git diff --git a/lustre/quota/quota_ctl.c b/lustre/quota/quota_ctl.c index 5e8cd88..ad4f9a4 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -151,6 +151,7 @@ int filter_quota_ctl(struct obd_device *unused, struct obd_export *exp, } if (oqctl->qc_cmd == Q_FINVALIDATE && (obt->obt_qctxt.lqc_flags & UGQUOTA2LQC(oqctl->qc_type))) { + atomic_inc(&obt->obt_quotachecking); rc = -EBUSY; break; } @@ -164,7 +165,7 @@ int filter_quota_ctl(struct obd_device *unused, struct obd_export *exp, * dqacq/dqrel done then return the correct limits to master */ if (oqctl->qc_stat == QUOTA_RECOVERING) qctxt_wait_pending_dqacq(&obd->u.obt.obt_qctxt, - oqctl->qc_id, oqctl->qc_type, + oqctl->qc_id, oqctl->qc_type, 1); push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); @@ -336,6 +337,7 @@ int lov_quota_ctl(struct obd_device *unused, struct obd_export *exp, { struct obd_device *obd = class_exp2obd(exp); struct lov_obd *lov = &obd->u.lov; + struct lov_tgt_desc *tgt; __u64 curspace = 0; __u64 bhardlimit = 0; int i, rc = 0; @@ -351,10 +353,13 @@ int lov_quota_ctl(struct obd_device *unused, struct obd_export *exp, RETURN(-EFAULT); } + /* for lov tgt */ + obd_getref(obd); for (i = 0; i < lov->desc.ld_tgt_count; i++) { int err; - if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) { + tgt = lov->lov_tgts[i]; + if (!tgt || !tgt->ltd_active || tgt->ltd_reap) { if (oqctl->qc_cmd == Q_GETOQUOTA) { CERROR("ost %d is inactive\n", i); rc = -EIO; @@ -364,9 +369,9 @@ int lov_quota_ctl(struct obd_device *unused, struct obd_export *exp, continue; } - err = obd_quotactl(lov->lov_tgts[i]->ltd_exp, oqctl); + err = obd_quotactl(tgt->ltd_exp, oqctl); if (err) { - if (lov->lov_tgts[i]->ltd_active && !rc) + if (tgt->ltd_active && !rc) rc = err; continue; } @@ -376,6 +381,7 @@ int lov_quota_ctl(struct obd_device *unused, struct obd_export *exp, bhardlimit += oqctl->qc_dqblk.dqb_bhardlimit; } } + obd_putref(obd); if (oqctl->qc_cmd == Q_GETOQUOTA) { oqctl->qc_dqblk.dqb_curspace = curspace;