X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fquota%2Fqsd_handler.c;h=0982e935ae0adcb9c2b8fd874a7cf4dbc0ed771e;hb=11afef00b6af407b8987076bd4f1ec9bc77eb75e;hp=a87e231a53d65456b4aa28b459d3257007bf9ed6;hpb=e64d9101cc8ebc61924d6e9db6d7ab3cfa94767c;p=fs%2Flustre-release.git diff --git a/lustre/quota/qsd_handler.c b/lustre/quota/qsd_handler.c index a87e231..0982e93 100644 --- a/lustre/quota/qsd_handler.c +++ b/lustre/quota/qsd_handler.c @@ -21,7 +21,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2014, Intel Corporation. * Use is subject to license terms. * * Author: Johann Lombardi @@ -45,7 +45,7 @@ static inline int qsd_request_enter(struct lquota_entry *lqe) } if (lqe->lqe_pending_rel != 0) { - LQUOTA_ERROR(lqe, "no request in flight with pending_rel="LPU64, + LQUOTA_ERROR(lqe, "no request in flight with pending_rel=%llu", lqe->lqe_pending_rel); LBUG(); } @@ -350,12 +350,12 @@ static void qsd_req_completion(const struct lu_env *env, * the DQACQ since the limit for this ID has been removed, so we * should not update quota entry & slave index copy neither. */ if (repbody != NULL && repbody->qb_count != 0) { - LQUOTA_DEBUG(lqe, "DQACQ qb_count:"LPU64, repbody->qb_count); + LQUOTA_DEBUG(lqe, "DQACQ qb_count:%llu", repbody->qb_count); if (req_is_rel(reqbody->qb_flags)) { if (lqe->lqe_granted < repbody->qb_count) { LQUOTA_ERROR(lqe, "can't release more space " - "than owned "LPU64"<"LPU64, + "than owned %llu<%llu", lqe->lqe_granted, repbody->qb_count); lqe->lqe_granted = 0; @@ -385,7 +385,7 @@ static void qsd_req_completion(const struct lu_env *env, } /* extract information from lvb */ - if (ret == 0 && lvb != 0) { + if (ret == 0 && lvb != NULL) { if (lvb->lvb_id_qunit != 0) qsd_set_qunit(lqe, lvb->lvb_id_qunit); qsd_set_edquot(lqe, !!(lvb->lvb_flags & LQUOTA_FL_EDQUOT)); @@ -634,7 +634,7 @@ static bool qsd_acquire(const struct lu_env *env, struct lquota_entry *lqe, ENTRY; for (count = 0; rc == 0; count++) { - LQUOTA_DEBUG(lqe, "acquiring:"LPD64 " count=%d", space, count); + LQUOTA_DEBUG(lqe, "acquiring:%lld count=%d", space, count); if (lqe2qqi(lqe)->qqi_qsd->qsd_stopping) { rc = -EINPROGRESS; @@ -722,7 +722,7 @@ static int qsd_op_begin0(const struct lu_env *env, struct qsd_qtype_info *qqi, RETURN(0); } - LQUOTA_DEBUG(lqe, "op_begin space:"LPD64, space); + LQUOTA_DEBUG(lqe, "op_begin space:%lld", space); lqe_write_lock(lqe); lqe->lqe_waiting_write += space; @@ -833,6 +833,9 @@ int qsd_op_begin(const struct lu_env *env, struct qsd_instance *qsd, if (unlikely(qsd == NULL)) RETURN(0); + if (qsd->qsd_dev->dd_rdonly) + RETURN(0); + /* We don't enforce quota until the qsd_instance is started */ read_lock(&qsd->qsd_lock); if (!qsd->qsd_started) { @@ -922,6 +925,9 @@ int qsd_adjust(const struct lu_env *env, struct lquota_entry *lqe) qqi = lqe2qqi(lqe); qsd = qqi->qqi_qsd; + if (qsd->qsd_dev->dd_rdonly) + RETURN(0); + lqe_write_lock(lqe); /* fill qb_count & qb_flags */ @@ -1075,6 +1081,9 @@ void qsd_op_end(const struct lu_env *env, struct qsd_instance *qsd, if (unlikely(qsd == NULL)) RETURN_EXIT; + if (qsd->qsd_dev->dd_rdonly) + RETURN_EXIT; + /* We don't enforce quota until the qsd_instance is started */ read_lock(&qsd->qsd_lock); if (!qsd->qsd_started) { @@ -1151,7 +1160,7 @@ void qsd_op_adjust(const struct lu_env *env, struct qsd_instance *qsd, lqe = lqe_locate(env, qqi->qqi_site, qid); if (IS_ERR(lqe)) { - CERROR("%s: fail to locate lqe for id:"LPU64", type:%d\n", + CERROR("%s: fail to locate lqe for id:%llu, type:%d\n", qsd->qsd_svname, qid->qid_uid, qtype); RETURN_EXIT; }