#define OBD_FAIL_MDS_INTENT_DELAY 0x160
#define OBD_FAIL_MDS_XATTR_REP 0x161
#define OBD_FAIL_MDS_TRACK_OVERFLOW 0x162
+#define OBD_FAIL_MDS_LOV_CREATE_RACE 0x163
/* layout lock */
#define OBD_FAIL_MDS_NO_LL_GETATTR 0x170
/*
* do not put >1 objects on a single OST
*/
- if (speed && lod_qos_is_ost_used(env, ost_idx, stripe_idx))
+ if (lod_qos_is_ost_used(env, ost_idx, stripe_idx))
goto out_return;
o = lod_qos_declare_object_on(env, m, ost_idx, th);
*/
lod_qos_ost_in_use(env, stripe_idx, ost_idx);
stripe[stripe_idx] = o;
+ OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_LOV_CREATE_RACE, 2);
stripe_idx++;
*s_idx = stripe_idx;
}
run_test 92 "create remote directory under orphan directory"
+test_93() {
+ local rc1=0
+ local rc2=0
+ local old_rr
+
+ mkdir -p $DIR1/$tfile-1/
+ mkdir -p $DIR2/$tfile-2/
+ local old_rr=$(do_facet $SINGLEMDS lctl get_param -n \
+ 'lod.lustre-MDT*/qos_threshold_rr' | sed -e 's/%//')
+ do_facet $SINGLEMDS lctl set_param -n \
+ 'lod.lustre-MDT*/qos_threshold_rr' 100
+ #define OBD_FAIL_MDS_LOV_CREATE_RACE 0x163
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x00000163"
+
+ $SETSTRIPE -c -1 $DIR1/$tfile-1/file1 &
+ local PID1=$!
+ sleep 1
+ $SETSTRIPE -c -1 $DIR2/$tfile-2/file2 &
+ local PID2=$!
+ wait $PID2
+ wait $PID1
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
+ do_facet $SINGLEMDS "lctl set_param -n \
+ 'lod.lustre-MDT*/qos_threshold_rr' $old_rr"
+
+ $GETSTRIPE $DIR1/$tfile-1/file1
+ rc1=$($GETSTRIPE -q $DIR1/$tfile-1/file1 |
+ awk '{if (/[0-9]/) print $1 }' | sort | uniq -d | wc -l)
+ $GETSTRIPE $DIR2/$tfile-2/file2
+ rc2=$($GETSTRIPE -q $DIR2/$tfile-2/file2 |
+ awk '{if (/[0-9]/) print $1 }' | sort | uniq -d | wc -l)
+ echo "rc1=$rc1 and rc2=$rc2 "
+ [ $rc1 -eq 0 ] && [ $rc2 -eq 0 ] ||
+ error "object allocate on same ost detected"
+}
+run_test 93 "alloc_rr should not allocate on same ost"
+
log "cleanup: ======================================================"
# kill and wait in each test only guarentee script finish, but command in script