once SOM attributes are moved to EA, there is no need to disabled quota when SOM is enabled
i=fanyong
i=tappro
#define LUSTRE_Q_FINVALIDATE 0x80000c /* invalidate filter quota data */
#define UGQUOTA 2 /* set both USRQUOTA and GRPQUOTA */
-#define IMMQUOTA 0x4 /* set immutable quota flag, cannot be turned on/off
- * on-fly. temporary used by SOM */
struct if_quotacheck {
char obd_type[16];
* 0:Off, 1:On
*/
lqc_valid:1, /** this qctxt is valid or not */
- lqc_setup:1, /**
+ lqc_setup:1; /**
* tell whether of not quota_type has
* been processed, so that the master
* knows when it can start processing
* incoming acq/rel quota requests
*/
- lqc_immutable:1; /**
- * cannot be turned on/off on-fly;
- * temporary used by SOM.
- */
/** }@ */
/**
* original unit size of file quota and
mdt->mdt_som_conf ? "en" : "dis");
}
-#ifdef HAVE_QUOTA_SUPPORT
-static int mdt_quota_off(struct mdt_device *mdt)
-{
- struct md_device *next = mdt->mdt_child;
- const struct md_quota_operations *mqo = &next->md_ops->mdo_quota;
- struct lu_env env;
- int rc;
-
- lu_env_init(&env, LCT_MD_THREAD);
- rc = mqo->mqo_off(&env, next, UGQUOTA | IMMQUOTA);
- lu_env_fini(&env);
- return rc;
-}
-#else
-static int mdt_quota_off(struct mdt_device *mdt)
-{
- return 0;
-}
-#endif
-
static int lprocfs_wr_mdt_som(struct file *file, const char *buffer,
unsigned long count, void *data)
{
struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
char kernbuf[16];
unsigned long val = 0;
- int rc;
if (count > (sizeof(kernbuf) - 1))
return -EINVAL;
return count;
}
- if ((rc = mdt_quota_off(mdt))) {
- if (rc == -EALREADY)
- rc = 0;
- else
- return rc;
- }
-
mdt->mdt_som_conf = val;
LCONSOLE_INFO("Enabling SOM\n");
i_size_write(inode, attr->la_size);
}
+#if 0
/* OSD should not change "i_blocks" which is used by quota.
- * "i_blocks" should be changed by ldiskfs only.
- * Enable this assignment for SOM purpose now, until it is
- * stored in SOM EA. */
+ * "i_blocks" should be changed by ldiskfs only. */
if (bits & LA_BLOCKS)
inode->i_blocks = attr->la_blocks;
-
+#endif
if (bits & LA_MODE)
inode->i_mode = (inode->i_mode & S_IFMT) |
(attr->la_mode & ~S_IFMT);
if ((obt->obt_qctxt.lqc_flags & id) == id)
GOTO(out, rc);
- if (obt->obt_qctxt.lqc_immutable) {
- LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
- "(is SOM enabled?)\n");
- GOTO(out, rc = -ECANCELED);
- }
-
oqctl->qc_type = type;
oqctl->qc_cmd = Q_QUOTAON;
oqctl->qc_id = obt->obt_qfmt;
RETURN(-EINVAL);
cfs_down(&obt->obt_quotachecking);
- if (obt->obt_qctxt.lqc_immutable) {
- LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
- "(is SOM enabled?)\n");
- cfs_up(&obt->obt_quotachecking);
- RETURN(-ECANCELED);
- }
-
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cfs_down(&mds->mds_qonoff_sem);
rc2 = mds_admin_quota_on(obd, oqctl);
struct obd_device_target *obt = &obd->u.obt;
struct lustre_quota_ctxt *qctxt = &obt->obt_qctxt;
struct lvfs_run_ctxt saved;
- int rc = 0, rc1 = 0, rc2 = 0, imm;
+ int rc = 0, rc1 = 0, rc2 = 0;
ENTRY;
LASSERT_SEM_LOCKED(&obt->obt_quotachecking);
- imm = oqctl->qc_type & IMMQUOTA;
- oqctl->qc_type &= ~IMMQUOTA;
-
if (oqctl->qc_type != USRQUOTA &&
oqctl->qc_type != GRPQUOTA &&
oqctl->qc_type != UGQUOTA)
rc1 = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl);
if (!rc1) {
- if (imm)
- obt->obt_qctxt.lqc_immutable = 1;
obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type);
} else if (quota_is_off(qctxt, oqctl)) {
CWARN("mds local quota[%d] is off already\n", oqctl->qc_type);
mds_admin_quota_on(obd, oqctl);
if (rc1 != -EALREADY) {
fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl);
- if (imm)
- obt->obt_qctxt.lqc_immutable = 0;
qctxt->lqc_flags |= UGQUOTA2LQC(oqctl->qc_type);
}
oqctl->qc_cmd = Q_QUOTAOFF;
check_and_setup_lustre
-if [ x"$(som_check)" = x"enabled" ]; then
- echo "Som is enabled, Quota is temporary conflicts with it"
- check_and_cleanup_lustre
- export QUOTA_AUTO=$QUOTA_AUTO_OLD
- exit 0
-fi
-
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
[ $period -lt $timeout ] || log "$count OST are inactive after $timeout seconds, give up"
}
-som_check() {
- SOM_ENABLED=$(do_facet $SINGLEMDS "$LCTL get_param mdt.*.som" | awk -F= ' {print $2}' | head -n 1)
- echo $SOM_ENABLED
-}
-
init_param_vars () {
if ! remote_ost_nodsh && ! remote_mds_nodsh; then
export MDSVER=$(do_facet $SINGLEMDS "lctl get_param version" | cut -d. -f1,2)
osc_ensure_active $SINGLEMDS M $TIMEOUT
osc_ensure_active client c $TIMEOUT
- if [ x"$(som_check)" = x"enabled" ]; then
- ENABLE_QUOTA=""
- echo "disable quota temporary when SOM enabled"
- fi
if [ $QUOTA_AUTO -ne 0 ]; then
if [ "$ENABLE_QUOTA" ]; then
echo "enable quota as required"