fix quota for the patch of bz19778.
a=tianzy
i=fanyong
i=andrew.perepechko
int rc;
ENTRY;
- if (OBD_FAIL_CHECK(OBD_FAIL_MDS_QUOTACHECK_NET))
- RETURN(0);
-
oqctl = req_capsule_client_get(pill, &RMF_OBD_QUOTACTL);
if (oqctl == NULL)
RETURN(-EPROTO);
int id, rc;
ENTRY;
- if (OBD_FAIL_CHECK(OBD_FAIL_MDS_QUOTACTL_NET))
- RETURN(0);
-
oqctl = req_capsule_client_get(pill, &RMF_OBD_QUOTACTL);
if (oqctl == NULL)
RETURN(-EPROTO);
* Checking for various OBD_FAIL_$PREF_$OPC_NET codes. _Do_ not try
* to put same checks into handlers like mdt_close(), mdt_reint(),
* etc., without talking to mdt authors first. Checking same thing
- * there again is useless and returning 0 error wihtout packing reply
+ * there again is useless and returning 0 error without packing reply
* is buggy! Handlers either pack reply or return error.
*
* We return 0 here and do not send any reply in order to emulate
{
struct obd_device *obd = data;
- return snprintf(page, count, "%u\n",
+ return snprintf(page, count, "%d\n",
atomic_read(&obd->u.cli.cl_quota_resends));
}
if (rc)
return rc;
- if (val < 0)
- return -EINVAL;
-
atomic_set(&obd->u.cli.cl_quota_resends, val);
return count;
static inline int client_quota_should_resend(int resend, struct client_obd *cli)
{
- return atomic_read(&cli->cl_quota_resends) ?
+ return (atomic_read(&cli->cl_quota_resends) >= 0) ?
atomic_read(&cli->cl_quota_resends) > resend : 1;
}
remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="9 10 11 18b 21 29"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="9 10 11 18b 21"
QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
local BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
local timeout
local pid
- local resends
+ local origin_resends
if at_is_enabled; then
timeout=$(at_max_get client)
lctl set_param timeout=10
fi
- resends=$(lctl get_param -n mdc.${FSNAME}-*.quota_resend_count | head -1)
+ origin_resends=$(lctl get_param -n mdc.${FSNAME}-*.quota_resend_count | head -1)
+ lctl set_param -n mdc.${FSNAME}-*.quota_resend_count 0
#define OBD_FAIL_MDS_QUOTACTL_NET 0x12e
lustre_fail mds 0x12e
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR & pid=$!
- echo "sleeping for $((10 * resends + 5)) seconds"
- sleep $((10 * resends + 5))
+ echo "sleeping for $((10 * 2)) seconds"
+ sleep $((10 * 2))
ps -p $pid && error "lfs hadn't finished by timeout"
wait $pid && error "succeeded, but should have failed"
lctl set_param timeout=$timeout
fi
+ lctl set_param -n mdc.${FSNAME}-*.quota_resend_count $origin_resends
resetquota -u $TSTUSR
}
run_test_with_stat 29 "unhandled quotactls must not hang lustre client (19778) ========"