summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.org>2026-11-04 11:36:28 -0300
committerPaulo Alcantara <pc@manguebit.org>2026-11-11 13:51:10 -0300
commitf778a530f28546956e5f58db486fb74376f5d869 (patch)
tree7cc30a8e37b3728435ede0ea6f30d47971e127e4 /tools/perf/scripts/python
parent1d1981b7910c48649f957e0f1d4299ea05c9a072 (diff)
smb: client: stop reconnecting and replaying during a forced unmount
umount -f of a gone server on a hard mount hangs the teardown. cifs_kill_sb() flushes the deferred-file, cached-dir and oplock-break work and then cifs_umount() sends a tree disconnect, but on a hard mount every reconnect wait in cifs_wait_for_server_reconnect() and every per-PDU replay loop (gated by smb2_should_replay()) retries forever, and the per-tcon abort count that umount -f bumps is only snapshotted on entry to smb2_reconnect(), so an operation that enters after the unmount began never observes it and waits or spins out the teardown (e.g. a close work item wedging flush_workqueue()). Mark each of the mount's tcons dying, master and per-user alike, waking their sessions' waiters, and have cifs_wait_for_server_reconnect(), cifs_tcon_retry() and smb2_should_replay() give up while it is set, so both the reconnect waits and the replay loops stop at every site, however late the operation entered. Keep it set, with the mount's tlinks pinned, until cifs_umount() has dropped them, then drop it on those tcons that another superblock still holds, and hand no dying tcon to a new mount. Also treat a tcon that no mount references any more as dying, waking its waiters when that happens, so that whatever still holds it (e.g. the cached directory laundromat, a cancelled close, or its tree disconnect after cifs_prune_tlinks()) stops too, and never reuse it. Also stop the reconnect worker from wedging: smb2_reconnect_server() holds a tcon or session reference across cifs_wait_for_server_reconnect(), so with the server gone it never returns, pinning the cifsiod worker and leaking the tcon, session, server and cifsd thread. It only needs to attempt the reconnect, so fail fast; it is retried once the transport is back. Reopen persistent handles from it once, without waiting, and reschedule it if one failed for a transient reason. Reads, metadata and SMB1 reconnect waits outside teardown still follow the hard and retrans mount options, except on a tcon shared with another mount, whose waits and replays give up too while the teardown runs; a task blocked in one can be killed, and open files keep umount -f from reaching teardown (-EBUSY). Signed-off-by: Paulo Alcantara <pc@manguebit.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions