struct batch_update_head *head = ouc->ouc_head;
struct obd_export *exp = head->buh_exp;
struct req_capsule *pill = item->mop_pill;
+ struct ldlm_reply *lockrep;
req_capsule_subreq_init(pill, &RQF_BUT_GETATTR, req,
NULL, repmsg, RCL_CLIENT);
if (rc)
GOTO(out, rc);
+ lockrep = req_capsule_server_get(pill, &RMF_DLM_REP);
+ LASSERT(lockrep != NULL);
+
+ lockrep->lock_policy_res2 =
+ ptlrpc_status_ntoh(lockrep->lock_policy_res2);
+
rc = mdc_finish_enqueue(exp, pill, einfo, &item->mop_it,
&item->mop_lockh, rc);
out:
if (!mdt_get_disposition(ldlm_rep, DISP_LOOKUP_POS) ||
ldlm_rep->lock_policy_res2) {
lhc->mlh_reg_lh.cookie = 0ull;
- GOTO(out_ucred, rc = ELDLM_LOCK_ABORTED);
+ /* Return error code immediately to stop batched statahead. */
+ GOTO(out_ucred, rc = info->mti_batch_env ? rc :
+ ELDLM_LOCK_ABORTED);
}
rc = mdt_intent_lock_replace(info, lockp, lhc, flags, rc);
$LCTL set_param mdc.*.batch_stats=0
echo "statahead_stats (Pre):"
- lctl get_param -n llite.*.statahead_stats
+ $LCTL get_param -n llite.*.statahead_stats
eval $iocmd || error "$iocmd failed"
echo "statahead_stats (Post):"
$LCTL get_param -n llite.*.statahead_stats
}
run_test 123i "Verify statahead work with the fname indexing pattern"
+test_123j() {
+ (( $MDSCOUNT > 1 )) || skip_env "needs >= 2 MDTs"
+
+ $LCTL get_param -n mdc.*.connect_flags | grep -q batch_rpc ||
+ skip "Server does not support batch RPC"
+
+ local enabled
+
+ enabled=$($LCTL get_param -n llite.*.enable_statahead_fname | head -n 1)
+ stack_trap "$LCTL set_param llite.*.enable_statahead_fname=$enabled"
+ $LCTL set_param llite.*.enable_statahead_fname=1
+
+ stack_trap "rm -rf $DIR/${tdir}.{1..11}"
+
+ mkdir $DIR/${tdir}.{1..10} ||
+ error "failed to mkdir $DIR/${tdir}.{1..10}"
+ cancel_lru_locks mdc
+
+ for i in $(seq 1 10); do
+ stat $DIR/${tdir}.$i || error "failed to stat $DIR/${tdir}.$i"
+ done
+
+ stat $DIR/${tdir}.11
+ $LFS mkdir -i $((MDSCOUNT - 1)) -c 2 -H all_char $DIR/${tdir}.11 ||
+ error "failed to mkdir $DIR/${tdir}.11"
+ touch $DIR/${tdir}.11/$tfile ||
+ error "failed to create file $DIR/${tdir}.11/$tfile"
+}
+run_test 123j "-ENOENT error from batched statahead be handled correctly"
+
test_124a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
$LCTL get_param -n mdc.*.connect_flags | grep -q lru_resize ||