diff options
| author | Paulo Alcantara <pc@manguebit.org> | 2026-11-02 14:29:09 -0300 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-11-11 13:51:10 -0300 |
| commit | 9bd8ee0c16146a3d0a401b39dc4cb1a84144c956 (patch) | |
| tree | 0bdf29cfc4080817d00f5c5bd22469b2da6f4abd /tools/perf/scripts/python | |
| parent | f8ea398448ce4adf32493649ab6665ab1f858d10 (diff) | |
smb: client: don't replay handle reopens inside SMB2_open()
cifs_reopen_file_retry() reopens a read's or write's handle with backoff,
per the hard and retrans mount options, giving up on umount -f. It calls
cifs_reopen_file() -> SMB2_open(), which replays replayable errors on its
own, also per hard and retrans. So each reopen is retried at both
layers: up to (retrans + 1)^2 opens on a soft mount, and, on a hard
mount, forever inside SMB2_open() without ever returning to
cifs_reopen_file_retry() to notice umount -f - a worker doing writeback
then can't be stopped.
Have cifs_reopen_file_retry() tell SMB2_open() not to replay, so these
reopens are bounded and stopped only by cifs_reopen_file_retry(). Other
callers of cifs_reopen_file() keep SMB2_open()'s replay; SMB1 opens are
unchanged.
A reopen reconnects the durable handle or, if the server lost it, opens
the file afresh. Without SMB2_open()'s loop, a retry must open afresh
again rather than reconnect, which the server would reject, and replay
its last create, with the same GUID and access and keeping its access
fallbacks, if that create may have been processed, or it leaks or loses
a handle. Track both on the open file under fh_mutex, so concurrent
reopens agree: replay only after a create that SMB2_open() built and
that failed with no answer from the server, or only a retryable one to
its replay, and leave the state alone after an attempt that was
interrupted or never built.
SMB2_open()'s own loop retried a failed durable reconnect as a fresh open
with a stale GUID, and smb2_open_file()'s retry without
FILE_READ_ATTRIBUTES as a fresh open, skipping the relock; have both
reissue the same create, only replay a create that was built, and don't
leave SMB2_open()'s own replay state behind for the caller's next create.
Fixes: 69c3c023af25 ("cifs: Implement netfslib hooks")
Fixes: 4f1fffa23769 ("cifs: commands that are retried should have replay flag set")
Fixes: 79520587fe42 ("cifs: update the same create_guid on replay")
Fixes: e255612b5ed9 ("cifs: Add fallback for SMB2 CREATE without FILE_READ_ATTRIBUTES")
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
