Commit dff71c6c authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Transaction limit 0 doesn't make any sense, enforce -L > 0

Also do not assert on empty incomplete list even though VTX count is
larger than L. This can happen when a complete multi-transaction
result is still unreported.

Original patch by Geoff Simmons (Uplex)
parent 8333a1bb
......@@ -343,7 +343,7 @@ VSL_Arg(struct VSL_data *vsl, int opt, const char *arg)
p++;
if (*p != '\0')
return (vsl_diag(vsl, "-L: Syntax error"));
if (l < 0 || l > INT_MAX)
if (l <= 0 || l > INT_MAX)
return (vsl_diag(vsl, "-L: Range error"));
vsl->L_opt = (int)l;
return (1);
......
......@@ -1344,7 +1344,8 @@ VSLQ_Dispatch(struct VSLQ *vslq, VSLQ_dispatch_f *func, void *priv)
}
/* Check store limit */
while (vslq->n_outstanding > vslq->vsl->L_opt) {
while (vslq->n_outstanding > vslq->vsl->L_opt &&
!(VTAILQ_EMPTY(&vslq->incomplete))) {
vtx = VTAILQ_FIRST(&vslq->incomplete);
CHECK_OBJ_NOTNULL(vtx, VTX_MAGIC);
vtx_force(vslq, vtx, "store overflow");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment