ENTRY;
+ LASSERT(ergo(fp == NULL, inode != NULL));
+
if (check_quota_file(fp, inode, type, LUSTRE_QUOTA_V2) == 0)
version = LUSTRE_QUOTA_V2;
else {
switch (oqctl->qc_cmd) {
case Q_QUOTAON:
- if (info->mti_mdt->mdt_som_conf) {
- /* Quota cannot be used together with SOM while
- * SOM stored blocks in i_blocks but not in SOM EA. */
- LCONSOLE_ERROR("Fail to turn Quota on: SOM is enabled "
- "and temporary conflicts with quota.\n");
- RETURN(-ENOTSUPP);
- }
rc = mqo->mqo_on(info->mti_env, next, oqctl->qc_type);
break;
case Q_QUOTAOFF:
return count;
}
- if ((rc = mdt_quota_off(mdt)))
- return rc;
+ if ((rc = mdt_quota_off(mdt))) {
+ if (rc == -EALREADY)
+ rc = 0;
+ else
+ return rc;
+ }
mdt->mdt_som_conf = val;
LCONSOLE_INFO("Enabling SOM\n");
if (obt->obt_qctxt.lqc_immutable) {
LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
"(is SOM enabled?)\n");
- GOTO(out, rc);
+ GOTO(out, rc = -ECANCELED);
}
oqctl->qc_type = type;
}
if (type != 0) {
- auto_quota_on(obd, type - 1, obt->obt_sb, is_mds);
- build_lqs(obd);
+ int rc = auto_quota_on(obd, type - 1, obt->obt_sb, is_mds);
+
+ if (rc == 0)
+ build_lqs(obd);
+ else if (rc != -EALREADY)
+ return rc;
}
return count;
RETURN(-EINVAL);
down(&obt->obt_quotachecking);
- LASSERT(!obt->obt_qctxt.lqc_immutable);
+ if (obt->obt_qctxt.lqc_immutable) {
+ LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
+ "(is SOM enabled?)\n");
+ up(&obt->obt_quotachecking);
+ RETURN(-ECANCELED);
+ }
+
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
down(&mds->mds_qonoff_sem);
rc2 = mds_admin_quota_on(obd, oqctl);
som_mode_switch $som1 $gl1 $gl2
som2=$(do_facet $mymds "$LCTL get_param mdt.*.som" | awk -F= ' {print $2}' | head -n 1)
- [ $som1 != $som2 ] || error "som is still "$som2
+ if [ $som1 == $som2 ]; then
+ error "som is still "$som2
+ if [ x$som2 = x"enabled" ]; then
+ som2="disabled"
+ else
+ som2="enabled"
+ fi
+ fi
gl1=$(get_ost_param "ldlm_glimpse_enqueue")
stat $DIR/$tfile >/dev/null