QDATA_DEBUG(qdata, "obd(%s): complete %s quota req\n",
obd->obd_name, (opc == QUOTA_DQACQ) ? "acq" : "rel");
+ /* do it only when a releasing quota req more than 5MB b=18491 */
+ if (opc == QUOTA_DQREL && qdata->qd_count >= 5242880)
+ OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_DELAY_REL, 5);
+
/* update local operational quota file */
if (rc == 0) {
__u64 count = QUSG(qdata->qd_count, QDATA_IS_BLK(qdata));
RETURN(rc1);
}
if (err || (rc < 0 && rc != -EBUSY && rc1 == 0) || is_master(qctxt))
- RETURN(err);
+ RETURN(err);
+
+ if (opc == QUOTA_DQREL && qdata->qd_count >= 5242880 &&
+ OBD_FAIL_CHECK(OBD_FAIL_QUOTA_DELAY_REL))
+ RETURN(err);
/* reschedule another dqacq/dqrel if needed */
qdata->qd_count = 0;
spin_unlock(&lqs->lqs_lock);
+ if (lqs->lqs_blk_rec < 0 &&
+ qdata[i].qd_count <
+ lqs->lqs_bwrite_pending - lqs->lqs_blk_rec - mb)
+ OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_DELAY_REL, 5);
+
/* When cycle is zero, lqs_*_pending will be changed. We will
* get reference of the lqs here and put reference of lqs in
* quota_pending_commit b=14784 */
}
run_test_with_stat 25 "test whether quota usage is transfered when chown/chgrp (18081) ==========="
+test_26() {
+ mkdir -p $DIR/$tdir
+ chmod 0777 $DIR/$tdir
+ TESTFILE="$DIR/$tdir/$tfile-0"
+ TESTFILE2="$DIR/$tdir/$tfile-1"
+ set_blk_tunesz 512
+ set_blk_unitsz 1024
+
+ wait_delete_completed
+
+ # every quota slave gets 20MB
+ b_limit=$((OSTCOUNT * 20 * 1024))
+ log "limit: ${b_limit}KB"
+ $LFS setquota -u $TSTUSR -b 0 -B $b_limit -i 0 -I 0 $DIR
+ sleep 3
+ quota_show_check b u $TSTUSR
+
+ $LFS setstripe $TESTFILE -c 1 -i 0
+ $LFS setstripe $TESTFILE2 -c 1 -i 0
+ chown $TSTUSR.$TSTUSR $TESTFILE
+ chown $TSTUSR.$TSTUSR $TESTFILE2
+
+ #define OBD_FAIL_QUOTA_DELAY_REL 0xA03
+ lustre_fail ost 0xA03
+
+ log " Write the first file..."
+ $RUNAS $DIRECTIO write $TESTFILE 0 10 $((BLK_SZ * 1024)) || quota_error u $TSTUSR "write failure, but expect success"
+ log " Delete the first file..."
+ rm -f $TESTFILE
+
+
+ wait_delete_completed
+
+ log " Write the second file..."
+ $RUNAS $DIRECTIO write $TESTFILE2 0 10 $((BLK_SZ * 1024)) || quota_error u $TSTUSR "write failure, but expect success"
+ log " Delete the second file..."
+ rm -f $TESTFILE2
+
+ lustre_fail ost 0
+ set_blk_unitsz $((128 * 1024))
+ set_blk_tunesz $((128 * 1024 / 2))
+ resetquota -u $TSTUSR
+}
+run_test_with_stat 26 "test for false quota error(bz18491) ======================================"
+
# turn off quota
test_99()
{