From feb333ddc5d10c1ed5a7e138fc0cca7080f856f9 Mon Sep 17 00:00:00 2001 From: tianzy Date: Tue, 1 Jul 2008 10:10:28 +0000 Subject: [PATCH] Branch b1_8 this bug only happens when inode quota limitation is very low(less than 12), so that inode quota unit is 1 at initialization. Now least quota qunit is 2, instead of 1. b=15758 i=andrew.perepechko i=johann --- lustre/ChangeLog | 8 ++++++++ lustre/quota/quota_context.c | 3 ++- lustre/quota/quota_master.c | 3 ++- lustre/tests/sanity-quota.sh | 23 +++++++++++++++++------ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 0d142b5..6faec99 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -221,6 +221,14 @@ Details : OST crashes and subsequent e2fsck can lead to objects being moved tool, these objects can be retrieved and data can be salvaged by using the object ID saved in the fid. +Severity : minor +Frequency : rare +Bugzilla : 15758 +Description: this bug _only_ happens when inode quota limitation is very low + (less than 12), so that inode quota unit is 1 at initialization. +Details : if remaining quota equates 1, it is a sign to demonstate that quota + is effective now. So least quota qunit should be 2. + ------------------------------------------------------------------------------- diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index e213b21..451cabc 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -760,6 +760,7 @@ schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, int rc2; QDATA_DEBUG(qdata, "local %s.\n", opc == QUOTA_DQACQ ? "DQACQ" : "DQREL"); + QDATA_SET_CHANGE_QS(qdata); rc = qctxt->lqc_handler(obd, qdata, opc); rc2 = dqacq_completion(obd, qctxt, qdata, rc, opc); RETURN(rc ? rc : rc2); @@ -939,7 +940,7 @@ qctxt_init(struct lustre_quota_ctxt *qctxt, struct super_block *sb, qctxt->lqc_switch_qs = 1; /* Change qunit size in default setting */ qctxt->lqc_cqs_boundary_factor = 4; qctxt->lqc_cqs_least_bunit = PTLRPC_MAX_BRW_SIZE; - qctxt->lqc_cqs_least_iunit = 1; + qctxt->lqc_cqs_least_iunit = 2; qctxt->lqc_cqs_qs_factor = 2; qctxt->lqc_atype = 0; qctxt->lqc_status= 0; diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 2ae2718..fbead72 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -368,7 +368,8 @@ int dqacq_handler(struct obd_device *obd, struct qunit_data *qdata, int opc) QUSG(*usage, QDATA_IS_BLK(qdata)) < hlimit) qdata->qd_count = (hlimit - QUSG(*usage, QDATA_IS_BLK(qdata))) - * QUOTABLOCK_SIZE; + * (QDATA_IS_BLK(qdata) ? + QUOTABLOCK_SIZE : 1); else GOTO(out, rc = -EDQUOT); } diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index f7f5bc8..98b0747 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -310,11 +310,18 @@ test_2_sub() { # file hard limit (normal use and out of quota) test_2() { for i in `seq 1 $cycle`; do - # define ino_qunit is between 10 and 100 - ino_qunit=$(( $RANDOM % 90 + 10 )) - ino_qtune=$(( $RANDOM % $ino_qunit )) - # RANDOM's maxium is 32767 - i_limit=$(( $RANDOM % 990 + 10 )) + if [ $i -eq 1 ]; then + ino_qunit=52 + ino_qtune=41 + i_limit=11 + else + # define ino_qunit is between 10 and 100 + ino_qunit=$(( $RANDOM % 90 + 10 )) + ino_qtune=$(( $RANDOM % $ino_qunit )) + # RANDOM's maxium is 32767 + i_limit=$(( $RANDOM % 990 + 10 )) + fi + set_file_tunesz $ino_qtune set_file_unitsz $ino_qunit echo "cycle: $i(total $cycle) iunit:$ino_qunit, itune:$ino_qtune, ilimit:$i_limit" @@ -450,7 +457,11 @@ test_file_soft() { $SHOW_QUOTA_INFO echo " Create file after timer goes off" - $RUNAS touch ${TESTFILE}_after ${TESTFILE}_after1 && \ + # the least of inode qunit is 2, so there are at most 3(qunit:2+qtune:1) + # inode quota left here + $RUNAS touch ${TESTFILE}_after ${TESTFILE}_after1 ${TESTFILE}_after2 || true + sync; sleep 1; sync + $RUNAS touch ${TESTFILE}_after3 && \ error "create after timer expired, but expect EDQUOT" sync; sleep 1; sync -- 1.8.3.1