diff options
| author | Paulo Alcantara <pc@manguebit.org> | 2026-11-02 14:53:12 -0300 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-11-11 13:51:10 -0300 |
| commit | 1d1981b7910c48649f957e0f1d4299ea05c9a072 (patch) | |
| tree | 055a04d4d105abee4257a8444a12326fbe3baaf8 /tools/perf/scripts/python/bin | |
| parent | 9bd8ee0c16146a3d0a401b39dc4cb1a84144c956 (diff) | |
smb: client: fail writeback sends and reopens fast when the server is gone
A writeback whose send or handle reopen finds the server needing
reconnect waits in smb2_reconnect() -> cifs_wait_for_server_reconnect()
for the reconnect to finish - on a hard mount until the server returns or
umount -f. But umount -f only breaks that wait for a request that entered
it before the abort count was bumped; a send or reopen that enters
afterwards, including the writeback that generic_shutdown_super() ->
sync_filesystem() starts during the unmount itself, snapshots the
already-bumped count and waits forever, hanging the unmount.
Issue writeback sends and reopens without waiting for the reconnect: pass
a nowait flag down to smb2_reconnect() and have it return -EAGAIN from
every point it would otherwise wait in or loop back to
cifs_wait_for_server_reconnect() - the initial need-reconnect check, the
wait itself, a need-reconnect seen after taking the session mutex, and a
failed renegotiation - not just the first. The subrequest is then
retried from the netfs collector, which backs off and re-checks umount -f
and the retry window before trying again. Reads, direct writes and every
other command keep waiting as before.
Writeback started between umount_begin() and cifs_kill_sb() can also
block the unmount from the flusher, which holds s_umount: in the reopen
retry loop, or in a credit wait, as credits only come back with a
reconnect. Defer writeback reopens to the worker, and fail writeback
credit waits with -EAGAIN while the connection needs reconnecting,
waking the waiters when it drops, so both get retried from the netfs
collector. Have only one subrequest of a request reopen per pass, the
others waiting for it and sharing its outcome, fail them right away once
reopening failed for good, back off before queueing once per pass rather
than per subrequest, and never block the flusher or the worker on
fh_mutex, which a reader stuck reconnecting may hold, so that a dead
mount can't tie up the shared worker for the other mounts, nor the
collector or the flusher. Let the pieces a
retry re-slices keep the retry state of the span they come from, and
make the reopen's own credit wait fail fast as well.
Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
