Files
scst/iscsi-scst/kernel
Gleb Chesnokov aeff3f67ab iscsi-scst: Measure shutdown grace from the start of the wait
The saved pre-fix Cppcheck log reports:

  iscsi-scst/kernel/nthread.c:326: style:
  Clarify calculation precedence for '+' and '?'. [clarifyCalculation]

close_conn calculates its shutdown deadline with this expression:

  shut_start_waiting + conn->deleting ? CONN_DEL_SHUT_TIMEOUT :
                                      CONN_REG_SHUT_TIMEOUT

Addition binds more tightly than the conditional operator. The expression
therefore tests shut_start_waiting + conn->deleting and selects an
absolute 10- or 125-second jiffies value, rather than adding an interval
to the start timestamp. On a host with sufficient uptime, the transport
can be closed immediately after shutdown starts.

Select the interval first, add it to shut_start_waiting, and retain the
wrap-safe time_after comparison. Move the check into a private helper so
its timing behavior can be covered without a live connection.

Add KUnit coverage for both deletion and normal shutdown, high uptime,
the ticks before/at/after expiry and jiffies wraparound. The tests retain
the original strict-after deadline convention.
2026-10-21 09:23:02 +03:00
..
2026-08-21 19:58:59 +03:00
2026-04-12 15:38:24 +03:00
2026-08-21 19:58:59 +03:00