diff options
| author | Paulo Alcantara <pc@manguebit.org> | 2026-10-28 23:06:28 -0300 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-11-09 12:35:39 -0300 |
| commit | adeb82ac455582eac1894d1ca1b0aba110a65cc3 (patch) | |
| tree | 4568e1f428ebe499aa8a73cad7b9fa0fed3404b6 /tools/perf/scripts/python/flamegraph.py | |
| parent | d1bb754ab9e775b0fbb2743d3df425c25a561114 (diff) | |
smb: client: let umount -f abort retried reads and writes
umount -f only wakes up tasks waiting on the server's queues. Reads and
writes being retried - forever on hard mounts - keep going, so with the
server gone the unmount still hangs in sync_filesystem() waiting for
their writeback. NFS kills outstanding RPCs on umount -f instead.
Count umount -f attempts per superblock and have each read and write
request remember the count it started with. Fail with -EIO, rather than
retry, reissue, issue or wait for credits, any subrequest of a request
that predates a umount -f once it is a retry or the server or share is
disconnected; a kworker doing writeback can't be signalled out of the
credit wait otherwise. First attempts on a connected server still go
ahead, and requests started later aren't aborted (but see below), so
I/O on a healthy server keeps working if the unmount then fails with
-EBUSY or only detaches one of several mounts.
retry_count is not bumped yet when netfs_retry_write_stream() calls
prepare_write() for the first retry, so don't rely on it alone to tell a
reissue from a first attempt: treat a subrequest as a retry when it
already carries an xid (it has been prepared before) in
prepare_write()/prepare_read(), or when its replay flag is set in
cifs_io_aborted(), and abort it when the mount is going away even if the
connection still looks healthy.
Requests created after umount -f - writeback kicked off by the background
flusher, an oplock break or sync_filesystem() during the final teardown -
snapshot the already bumped count and would otherwise retry forever on a
hard mount, hanging cifs_kill_sb(). Once a superblock that saw a umount
-f reaches cifs_kill_sb() the mount is going away for good, so flag it and
stop retrying I/O on it too; one that never saw a umount -f still
flushes as before.
A sync(2) or syncfs() waiting under s_umount for writeback started after
umount -f would still keep the unmount from reaching cifs_kill_sb(), so
also stop retrying such I/O while s_umount is contended. After a failed
umount -f, that also stops reads and writes retrying while a remount,
freeze or new mount of the same superblock waits on s_umount.
Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
