req->rq_no_resend = 1;
rc = ptlrpc_queue_wait(req);
- if (rc) {
+ if (rc)
CERROR("ptlrpc_queue_wait failed, rc: %d\n", rc);
- GOTO(out, rc);
- }
- oqc = NULL;
- if (req->rq_repmsg)
- oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
-
- if (oqc == NULL) {
+ if (req->rq_repmsg &&
+ (oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL))) {
+ *oqctl = *oqc;
+ } else if (!rc) {
CERROR ("Can't unpack obd_quotactl\n");
- GOTO(out, rc = -EPROTO);
+ rc = -EPROTO;
}
- *oqctl = *oqc;
EXIT;
-out:
+
ptlrpc_req_finished(req);
return rc;
dqblk->dqb_curinodes = 0;
dqblk->dqb_curspace = 0;
rc = mds_get_space(obd, oqctl);
+
+ /*
+ * Querying of curinodes and/or curspace may have failed, administrative
+ * quota data are likely to be better approximation to the real usage in
+ * this case.
+ */
+ if (!(dqblk->dqb_valid & QIF_INODES) && dquot->dq_dqb.dqb_curinodes > 0)
+ dqblk->dqb_curinodes = dquot->dq_dqb.dqb_curinodes;
+
+ if (!(dqblk->dqb_valid & QIF_SPACE) && dquot->dq_dqb.dqb_curspace > 0)
+ dqblk->dqb_curspace = dquot->dq_dqb.dqb_curspace;
+
RETURN(rc);
out:
.qc_type = UGQUOTA };
char *obd_type = (char *)qctl.obd_type;
char *obd_uuid = (char *)qctl.obd_uuid.uuid;
- int rc, rc1 = 0, rc2 = 0, rc3 = 0, verbose = 0, pass = 0, quiet = 0;
+ int rc, rc1 = 0, rc2 = 0, rc3 = 0,
+ verbose = 0, pass = 0, quiet = 0, inacc;
char *endptr;
__u32 valid = QC_GENERAL, idx = 0;
if (qctl.qc_valid != QC_GENERAL)
mnt = "";
+ inacc = (qctl.qc_cmd == LUSTRE_Q_GETQUOTA) &&
+ ((qctl.qc_dqblk.dqb_valid&(QIF_LIMITS|QIF_USAGE))!=(QIF_LIMITS|QIF_USAGE));
+
print_quota(mnt, &qctl, QC_GENERAL, rc1);
if (qctl.qc_valid == QC_GENERAL && qctl.qc_cmd != LUSTRE_Q_GETINFO && verbose) {
rc3 = print_obd_quota(mnt, &qctl, 0);
}
- if (rc1 || rc2 || rc3)
+ if (rc1 || rc2 || rc3 || inacc)
printf("Some errors happened when getting quota info. "
"Some devices may be not working or deactivated. "
"The data in \"[]\" is inaccurate.\n");