}
spin_unlock(&lqs->lqs_lock);
- lqs_putref(lqs);
+ /* When cycle is zero, lqs_*_pending will be changed. We will
+ * putref lqs in quota_pending_commit instead of here b=14784 */
+ if (cycle)
+ lqs_putref(lqs);
}
if (rc2[0] == QUOTA_RET_ACQUOTA || rc2[1] == QUOTA_RET_ACQUOTA)
quota_search_lqs(&qdata[i], NULL, qctxt, &lqs);
if (lqs) {
+ int flag = 0;
spin_lock(&lqs->lqs_lock);
CDEBUG(D_QUOTA, "pending: %lu, count: %d.\n",
isblk ? lqs->lqs_bwrite_pending :
lqs->lqs_iwrite_pending, count);
if (isblk) {
- if (lqs->lqs_bwrite_pending >= count)
+ if (lqs->lqs_bwrite_pending >= count) {
lqs->lqs_bwrite_pending -= count;
- else
+ flag = 1;
+ } else {
CDEBUG(D_ERROR,
"there are too many blocks!\n");
+ }
} else {
- if (lqs->lqs_iwrite_pending >= count)
+ if (lqs->lqs_iwrite_pending >= count) {
lqs->lqs_iwrite_pending -= count;
- else
+ flag = 1;
+ } else {
CDEBUG(D_ERROR,
"there are too many files!\n");
+ }
}
spin_unlock(&lqs->lqs_lock);
lqs_putref(lqs);
+ /* When lqs_*_pening is changed back, we'll putref lqs
+ * here b=14784 */
+ if (flag)
+ lqs_putref(lqs);
}
}
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
+ wait_delete_completed
+
# test for user
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR 0 $LIMIT 0 0 $DIR
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
+ wait_delete_completed
+
# test for user
log " User quota (limit: $LIMIT files)"
$LFS setquota -u $TSTUSR 0 0 0 $LIMIT $DIR
TIMER=$(($2 * 3 / 2))
OFFSET=0
+ wait_delete_completed
+
echo " Write to exceed soft limit"
RUNDD="$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ"
$RUNDD count=$((BUNIT_SZ+1)) || \
# cleanup
rm -f $TESTFILE
+ sync; sleep 3; sync;
}
# block soft limit (start timer, timer goes off, stop timer)
LIMIT=$2
TIMER=$(($3 * 3 / 2))
+ wait_delete_completed
+
echo " Create files to exceed soft limit"
$RUNAS createmany -m ${TESTFILE}_ $((LIMIT + 1)) || \
error "create failure, but expect success"
# cleanup
rm -f ${TESTFILE}_xxx
+ sync; sleep 3; sync;
}
# file soft limit (start timer, timer goes off, stop timer)
GR_STR5="5c"
GR_STR6="1111111111111111"
+ wait_delete_completed
+
# test of valid grace strings handling
echo " Valid grace strings test"
$LFS setquota -t -u $GR_STR1 $GR_STR2 $DIR
BLIMIT=$(( $BUNIT_SZ * $((OSTCOUNT + 1)) * 10)) # 10 bunits on each server
ILIMIT=$(( $IUNIT_SZ * 10 )) # 10 iunits on mds
+ wait_delete_completed
+
echo " Set quota limit (0 $BLIMIT 0 $ILIMIT) for $TSTUSR.$TSTUSR"
$LFS setquota -u $TSTUSR 0 $BLIMIT 0 $ILIMIT $DIR
$LFS setquota -g $TSTUSR 0 $BLIMIT 0 $ILIMIT $DIR
# cleanup
unlinkmany $DIR/$tdir/$tfile-0_ $((ILIMIT + 1))
+ sync; sleep 3; sync;
$LFS setquota -u $TSTUSR 0 0 0 0 $DIR
$LFS setquota -g $TSTUSR 0 0 0 0 $DIR
return 0;
fi
+ wait_delete_completed
+
chmod 0777 $DIR/$tdir
LIMIT=$((BUNIT_SZ * (OSTCOUNT + 1) * 5)) # 5 bunits per server
# cleanup
rm -f $FILEA
+ sync; sleep 3; sync;
+
$LFS setquota -u $TSTUSR 0 0 0 0 $DIR
$LFS setquota -g $TSTUSR 0 0 0 0 $DIR
return 0
chmod 0777 $DIR/$tdir
remote_mds && skip "remote mds" && return 0
+ wait_delete_completed
+
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) ))
TESTFILE="$DIR/$tdir/$tfile-0"
[ ! -d $DBENCH_LIB ] && skip "dbench not installed" && return 0
+ wait_delete_completed
+
echo " Set enough high limit for user: $TSTUSR"
$LFS setquota -u $TSTUSR 0 $BLK_LIMIT 0 $FILE_LIMIT $DIR
echo " Set enough high limit for group: $TSTUSR"
RC=$?
rm -f client.txt
+ sync; sleep 3; sync;
+
cd $SAVE_PWD
return $RC
}
test_9() {
check_whether_skip && return 0
+ wait_delete_completed
+
set_blk_tunesz 512
set_blk_unitsz 1024
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
- wait_delete_completed
-
return $RC
}
run_test 9 "run for fixing bug10707(64bit) ==========="
chmod 0777 $DIR/$tdir
check_whether_skip && return 0
- sync; sleep 10; sync;
+ wait_delete_completed
set_blk_tunesz 512
set_blk_unitsz 1024
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
- wait_delete_completed
-
return $RC
}
run_test 10 "run for fixing bug10707(32bit) ==========="
test_11() {
+ wait_delete_completed
+
#prepare the test
block_limit=`(echo 0; df -t lustre -P | awk '{print $(NF - 4)}') | tail -n 1`
echo $block_limit
TESTFILE="$DIR/$tdir/$tfile-0"
TESTFILE2="$DIR2/$tdir/$tfile-1"
+ wait_delete_completed
+
echo " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR 0 $LIMIT 0 0 $DIR
error "files too small $fz + $fz2 < $((BUNIT_SZ * BLK_SZ * 10))"
rm -f $TESTFILE $TESTFILE.2
+ sync; sleep 3; sync;
$LFS setquota -u $TSTUSR 0 0 0 0 $DIR # clear user limit
}
# clean
unlinkmany ${TESTFILE} 15
rm -f $TESTFILE
+ sync; sleep 3; sync;
}
run_test 14 "test setting quota on root ==="
# 3. start quota in old mode and put some entries
# 4. restart quota in new mode forcing conversion and check the entries
+ wait_delete_completed
+
MISSING_USERS=""
for i in `seq 1 30`; do
check_runas_id_ret quota15_$i "runas -u quota15_$i"
LIMIT=$((24 * 1024 * 1024 * 1024 * 1024)) # 24 TB
PATTERN="`echo $DIR | sed 's/\//\\\\\//g'`"
+ wait_delete_completed
+
# test for user
$LFS setquota -u $TSTUSR 0 $LIMIT 0 0 $DIR || error "failed setting user quota limit $LIMIT"
TOTAL_LIMIT="`$LFS quota -u $TSTUSR $DIR | awk '/^.*'$PATTERN'.*[[:digit:]+][[:space:]+]/ { print $4 }'`"
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 4))
TESTFILE="$DIR/$tdir/$tfile"
+ wait_delete_completed
+
echo " User quota (limit: $LIMIT kbytes)"
if [ $1 == "u" ]; then
$LFS setquota -u $TSTUSR 0 $LIMIT 0 0 $DIR
fi
rm -f $TESTFILE
+ sync; sleep 3; sync;
$LFS setquota -$1 $TSTUSR 0 0 0 0 $DIR
}
set_blk_tunesz 512
set_blk_unitsz 1024
+ wait_delete_completed
+
#define OBD_FAIL_QUOTA_RET_QDATA | OBD_FAIL_ONCE
lustre_fail ost 0x80000A02