#define OBD_FAIL_QUOTA_RECOVERABLE_ERR 0xA04
#define OBD_FAIL_QUOTA_INIT 0xA05
#define OBD_FAIL_QUOTA_PREACQ 0xA06
+#define OBD_FAIL_QUOTA_RECALC 0xA07
#define OBD_FAIL_LPROC_REMOVE 0xB00
/* parse list of pool and destroy each element */
list_for_each_entry_safe(pool, tmp, &qmt->qmt_pool_list, qpi_linkage) {
+ /* stop all recalc threads - it may hold qpi reference */
+ qmt_stop_pool_recalc(pool);
/* release extra reference taken in qmt_pool_alloc */
qpi_putref(env, pool);
}
while (obd->obd_process_conf)
schedule_timeout_uninterruptible(cfs_time_seconds(1));
+ OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_RECALC, cfs_fail_val);
sem = qmt_sarr_rwsem(pool);
LASSERT(sem);
down_read(sem);
int rc, idx;
ENTRY;
+ if (qmt->qmt_stopping)
+ RETURN(0);
+
if (strnlen(poolname, LOV_MAXPOOLNAME + 1) > LOV_MAXPOOLNAME)
RETURN(-ENAMETOOLONG);
check_set_fallocate_or_skip
setup_quota_test || error "setup quota failed with $?"
- stack_trap cleanup_quota_test
# enable ost quota
set_ost_qtype $QTYPE || error "enable ost quota failed"
}
run_test 80 "check for EDQUOT after OST failover"
+test_81() {
+ local global_limit=20 # 100M
+ local testfile="$DIR/$tdir/$tfile-0"
+ local qpool="qpool1"
+
+ mds_supports_qp
+ setup_quota_test || error "setup quota failed with $?"
+
+ # enable ost quota
+ set_ost_qtype $QTYPE || error "enable ost quota failed"
+
+ # test for user
+ log "User quota (block hardlimit:$global_limit MB)"
+ $LFS setquota -u $TSTUSR -B 1G $DIR || error "set user quota failed"
+
+ pool_add $qpool || error "pool_add failed"
+ #define OBD_FAIL_QUOTA_RECALC 0xA07
+ do_facet mds1 $LCTL set_param fail_loc=0x80000A07 fail_val=30
+ # added OST casues to start pool recalculation
+ pool_add_targets $qpool 0 0 1
+ stop mds1 -f || error "MDS umount failed"
+
+ #start mds1 back to destroy created pool
+ start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
+ clients_up || true
+}
+run_test 81 "Race qmt_start_pool_recalc with qmt_pool_free"
+
quota_fini()
{
do_nodes $(comma_list $(nodes_list)) \