Do not resend quota_ctl requests infinitely.
i=Johann Lombardi
i=ZhiYong Tian
extern int lprocfs_wr_ping(struct file *file, const char *buffer,
unsigned long count, void *data);
-extern int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-extern int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer,
- unsigned long count, void *data);
-
/* Statfs helpers */
extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
int count, int *eof, void *data);
cfs_semaphore_t fo_init_lock; /* group initialization lock */
int fo_committed_group;
-#define CLIENT_QUOTA_DEFAULT_RESENDS 10
-
cfs_spinlock_t fo_objidlock; /* protect fo_lastobjid */
unsigned long fo_destroys_in_progress;
struct lu_client_seq *cl_seq;
cfs_atomic_t cl_resends; /* resend count */
- cfs_atomic_t cl_quota_resends; /* quota related resend count */
};
#define obd2cli_tgt(obd) ((char *)(obd)->u.cli.cl_target_uuid.uuid)
cli->cl_cksum_type = cli->cl_supp_cksum_types = OBD_CKSUM_CRC32;
#endif
cfs_atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS);
- cfs_atomic_set(&cli->cl_quota_resends, CLIENT_QUOTA_DEFAULT_RESENDS);
/* This value may be changed at connect time in
ptlrpc_connect_interpret. */
{ "mds_conn_uuid", lprocfs_rd_conn_uuid, 0, 0 },
{ "max_rpcs_in_flight", mdc_rd_max_rpcs_in_flight,
mdc_wr_max_rpcs_in_flight, 0 },
- { "quota_resend_count", lprocfs_rd_quota_resend_count,
- lprocfs_wr_quota_resend_count, 0},
{ "timeouts", lprocfs_rd_timeouts, 0, 0 },
{ "import", lprocfs_rd_import, 0, 0 },
{ "state", lprocfs_rd_state, 0, 0 },
return rc;
}
-int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = data;
-
- return snprintf(page, count, "%d\n",
- cfs_atomic_read(&obd->u.cli.cl_quota_resends));
-}
-
-int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = data;
- int val, rc;
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- cfs_atomic_set(&obd->u.cli.cl_quota_resends, val);
-
- return count;
-}
-
/* See also ptlrpc_lprocfs_rd_timeouts */
int lprocfs_rd_timeouts(char *page, char **start, off_t off, int count,
int *eof, void *data)
EXPORT_SYMBOL(lprocfs_rd_kbytesavail);
EXPORT_SYMBOL(lprocfs_rd_filestotal);
EXPORT_SYMBOL(lprocfs_rd_filesfree);
-EXPORT_SYMBOL(lprocfs_rd_quota_resend_count);
-EXPORT_SYMBOL(lprocfs_wr_quota_resend_count);
EXPORT_SYMBOL(lprocfs_write_helper);
EXPORT_SYMBOL(lprocfs_write_frac_helper);
{ "checksums", osc_rd_checksum, osc_wr_checksum, 0 },
{ "checksum_type", osc_rd_checksum_type, osc_wd_checksum_type, 0 },
{ "resend_count", osc_rd_resend_count, osc_wr_resend_count, 0},
- { "quota_resend_count", lprocfs_rd_quota_resend_count,
- lprocfs_wr_quota_resend_count, 0},
{ "timeouts", lprocfs_rd_timeouts, 0, 0 },
{ "contention_seconds", osc_rd_contention_seconds,
osc_wr_contention_seconds, 0 },
struct ptlrpc_request *req;
struct obd_quotactl *oqc;
const struct req_format *rf;
- int ver, opc, rc, resends = 0;
+ int ver, opc, rc;
ENTRY;
if (!strcmp(exp->exp_obd->obd_type->typ_name, LUSTRE_MDC_NAME)) {
RETURN(-EINVAL);
}
-restart_request:
-
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), rf, ver, opc);
if (req == NULL)
RETURN(-ENOMEM);
out:
ptlrpc_req_finished(req);
- if (client_quota_recoverable_error(rc)) {
- resends++;
- if (!client_quota_should_resend(resends, &exp->exp_obd->u.cli)) {
- CERROR("too many resend retries, returning error\n");
- RETURN(-EIO);
- }
-
- goto restart_request;
- }
-
return rc;
}
struct obd_quotactl *oqctl);
int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
-static inline int client_quota_recoverable_error(int rc)
-{
- return (rc == -ETIMEDOUT || rc == -EAGAIN);
-}
-
-static inline int client_quota_should_resend(int resend, struct client_obd *cli)
-{
- return (cfs_atomic_read(&cli->cl_quota_resends) >= 0) ?
- cfs_atomic_read(&cli->cl_quota_resends) > resend : 1;
-}
-
#endif
local BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
local timeout
local pid
- local origin_resends
if at_is_enabled; then
timeout=$(at_max_get client)
lctl set_param timeout=10
fi
- 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
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) ========"