From c7a42267f5740d587f726e610695f1c72818a21e Mon Sep 17 00:00:00 2001 From: ericm Date: Mon, 5 Oct 2009 15:00:05 +0000 Subject: [PATCH] branch: HEAD fix quota for the patch of bz19778. a=tianzy i=fanyong i=andrew.perepechko --- lustre/mdt/mdt_handler.c | 8 +------- lustre/obdclass/lprocfs_status.c | 5 +---- lustre/quota/quota_internal.h | 2 +- lustre/tests/sanity-quota.sh | 12 +++++++----- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index c6dfae9..6cc0c6c 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1696,9 +1696,6 @@ static int mdt_quotacheck_handle(struct mdt_thread_info *info) 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); @@ -1726,9 +1723,6 @@ static int mdt_quotactl_handle(struct mdt_thread_info *info) 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); @@ -2509,7 +2503,7 @@ static int mdt_req_handle(struct mdt_thread_info *info, * 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 diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 22acf70..c3f0249 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -928,7 +928,7 @@ int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off, { 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)); } @@ -942,9 +942,6 @@ int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer, if (rc) return rc; - if (val < 0) - return -EINVAL; - atomic_set(&obd->u.cli.cl_quota_resends, val); return count; diff --git a/lustre/quota/quota_internal.h b/lustre/quota/quota_internal.h index fa645b8..2bc82c0 100644 --- a/lustre/quota/quota_internal.h +++ b/lustre/quota/quota_internal.h @@ -219,7 +219,7 @@ static inline int client_quota_recoverable_error(int rc) 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; } diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index da10181..d752e97 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -57,7 +57,7 @@ unset ENABLE_QUOTA 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} @@ -2087,7 +2087,7 @@ test_29() 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) @@ -2097,15 +2097,16 @@ test_29() 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" @@ -2117,6 +2118,7 @@ test_29() 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) ========" -- 1.8.3.1