From cd40f5454d9fefcbdf0a2eb50dee78be5d19e72c Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Thu, 11 Feb 2010 12:39:36 -0800 Subject: [PATCH] b=1028 drop SOM dependency on quota once SOM attributes are moved to EA, there is no need to disabled quota when SOM is enabled i=fanyong i=tappro --- lustre/include/lustre/lustre_user.h | 2 -- lustre/include/lustre_quota.h | 6 +----- lustre/mdt/mdt_lproc.c | 28 ---------------------------- lustre/osd/osd_handler.c | 7 +++---- lustre/quota/lproc_quota.c | 6 ------ lustre/quota/quota_master.c | 16 +--------------- lustre/tests/sanity-quota.sh | 7 ------- lustre/tests/test-framework.sh | 9 --------- 8 files changed, 5 insertions(+), 76 deletions(-) diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 03a4423..8948c7f 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -342,8 +342,6 @@ typedef struct lu_fid lustre_fid; #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]; diff --git a/lustre/include/lustre_quota.h b/lustre/include/lustre_quota.h index a271ebf..03db1da 100644 --- a/lustre/include/lustre_quota.h +++ b/lustre/include/lustre_quota.h @@ -264,16 +264,12 @@ struct lustre_quota_ctxt { * 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 diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 34553d1..cb8ff1f 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -688,26 +688,6 @@ static int lprocfs_rd_mdt_som(char *page, char **start, off_t off, 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) { @@ -716,7 +696,6 @@ static int lprocfs_wr_mdt_som(struct file *file, const char *buffer, 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; @@ -753,13 +732,6 @@ static int lprocfs_wr_mdt_som(struct file *file, const char *buffer, 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"); diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 18b9539..302923c 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -1287,13 +1287,12 @@ static int osd_inode_setattr(const struct lu_env *env, 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); diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 6ac0bc2..d911365 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -225,12 +225,6 @@ static int auto_quota_on(struct obd_device *obd, int type, 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; diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 180e4cd..cc90f76 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -852,13 +852,6 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) 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); @@ -916,14 +909,11 @@ int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *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) @@ -940,8 +930,6 @@ int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl) 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); @@ -966,8 +954,6 @@ int do_mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl) 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; diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index b3abd20..589bc6a 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -70,13 +70,6 @@ export QUOTA_AUTO=0 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` diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index cf13aed..1f4a50c 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1875,11 +1875,6 @@ osc_ensure_active () { [ $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) @@ -1895,10 +1890,6 @@ init_param_vars () { 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" -- 1.8.3.1