Project

General

Profile

Actions

Bug #14868

closed

SMB reconnect fails when previous session still disconnecting

Added by Gordon Ross 2 months ago. Updated 13 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cifs - CIFS server and client
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
racktop:BSR-9839

Description

If a client is fast enough coming back in for a reconnect after their connection drops, they can race with the tear-down of their old session, which can cause odd failures like not finding their durable handles during the reconnect.
It's non-trivial to reproduce, but happens on a fast machine & network if you do enough disconnect/reconnects (I think it happened when there was a network stack bug causing TCP drops fairly frequently.)

Actions #1

Updated by Gordon Ross 2 months ago

  • Status changed from New to In Progress

Integrate this commit from github/Nexenta

commit 54d604f9c6eccd0eb3d3a0ce86bf31b721c33caa
Author: Prashanth Badari <prbadari@tintri.com>
Date:   Wed Jan 13 04:45:53 2021 +0000

    FIR-1506 SMB reconnect fails when previous session still disconnecting

    When TCP reset happens, wait for the trees to go away while we process
    the new session setup request which has the previous session id.
    Do no proceed with smb2_fsctl_odx_read when the request is not active.

    Reviewed by: Gordon Ross <gordon.ross@tintri.com>
    Reviewed by: Prashanth Badari <prbadari@tintri.com>
    Reviewed by: Suresh Jayaraman <sjayaraman@tintri.com>

2    0    usr/src/uts/common/fs/smbsrv/smb2_fsctl_odx.c
4    1    usr/src/uts/common/fs/smbsrv/smb2_fsctl_sparse.c
61    15    usr/src/uts/common/fs/smbsrv/smb_server.c
2    0    usr/src/uts/common/fs/smbsrv/smb_tree.c
49    0    usr/src/uts/common/fs/smbsrv/smb_user.c
3    0    usr/src/uts/common/smbsrv/smb_kproto.h
2    0    usr/src/uts/common/smbsrv/smb_ktypes.h
Actions #2

Updated by Electric Monk 2 months ago

  • Gerrit CR set to 2274
Actions #3

Updated by Gordon Ross 26 days ago

Ref. BSR-9839

Actions #4

Updated by Gordon Ross 21 days ago

Tested by forcibly resetting TCP sessions for connected clients.

The smbsrv-tests show no difference in output:
cd /var/tmp/test_results/smbsrv-tests
diff smbtor-smb2-20220911T164600.summary smbtor-smb2-20220913T211746.summary
(no output)

Actions #5

Updated by Electric Monk 20 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 1baeef3013bd4a2bff922e272ea7cd6da5a99908

commit  1baeef3013bd4a2bff922e272ea7cd6da5a99908
Author: Prashanth Badari <prbadari@tintri.com>
Date:   2022-09-15T00:07:10.000Z

    14868 SMB reconnect fails when previous session still disconnecting
    Reviewed by: Gordon Ross <gordon.ross@tintri.com>
    Reviewed by: Prashanth Badari <prbadari@tintri.com>
    Reviewed by: Suresh Jayaraman <sjayaraman@tintri.com>
    Reviewed by: Matt Barden <mbarden@tintri.com>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions #6

Updated by Gordon Ross 13 days ago

  • External Bug set to racktop:BSR-9839
Actions

Also available in: Atom PDF