Skip to content

Avoid reconnects of failed session setups on soft mounts

Stefan Metzmacher linux-cifs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13cifs: call wake_up(&server->response_q) inside of cifs_reconnect()fs/cifs/cifssmb.c fs/cifs/connect.c fs/cifs/smb2ops.c+2 -90 replies
2/13cifs: use mod_delayed_work() for &server->reconnect if already queuedfs/cifs/smb2pdu.c+2 -20 replies
3/13cifs: make use of cap_unix(ses) in cifs_reconnect_tcon()fs/cifs/cifssmb.c+1 -13 replies
4/13cifs: split out a cifs_connect_session_locked() helper functionfs/cifs/cifsproto.h fs/cifs/cifssmb.c fs/cifs/connect.c +2 more+49 -531 reply
5/13cifs: merge __{cifs,smb2}_reconnect[_tcon]() into cifs_tree_connect()fs/cifs/cifsproto.h fs/cifs/cifssmb.c fs/cifs/connect.c +1 more+89 -1621 reply
6/13cifs: abstract cifs_tcon_reconnect() out of smb2_reconnect()fs/cifs/cifsglob.h fs/cifs/cifsproto.h fs/cifs/connect.c +1 more+166 -1211 reply
7/13cifs: cifs_reconnect_tcon() make use of the generic cifs_tcon_reconnect() functionfs/cifs/cifssmb.c fs/cifs/connect.c+19 -1050 replies
8/13cifs: make cifs_tree_connect() staticfs/cifs/cifsproto.h fs/cifs/connect.c+6 -90 replies
9/13cifs: turn smb2_reconnect_server() into a generic cifs_reconnect_server()fs/cifs/connect.c fs/cifs/smb2pdu.c fs/cifs/smb2pdu.h +1 more+8 -100 replies
10/13cifs: move cifs_reconnect_tcons() to fs/cifs/connect.c and make it staticfs/cifs/connect.c fs/cifs/smb2pdu.c fs/cifs/smb2proto.h+72 -730 replies
11/13cifs: use reconnect timer also for SMB1fs/cifs/cifssmb.c+7 -10 replies
12/13cifs: map STATUS_ACCOUNT_LOCKED_OUT to -EACCESfs/cifs/smb2maperror.c+1 -10 replies
13/13cifs: introduce the CifsInvalidCredentials session statefs/cifs/cifs_debug.c fs/cifs/cifsfs.c fs/cifs/cifsglob.h +1 more+148 -41 reply

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchAurelien AptelPavel Shilovsky
1/13
2/13
3/13R-b R-b
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 00/13] Avoid reconnects of failed session setups on soft mounts

Commit b0dd940e582b6a6 ("cifs: fail i/o on soft mounts if sessionsetup errors out") didn't fix the whole problem. New i/o requests still try reconnects on the wire. But we need to avoid that in order to avoid locking out the user account.

The first patches consolidate the retry/reconnect handling between SMB1 and SMB2/3.

Then we map STATUS_ACCOUNT_LOCKED_OUT also to -EACCES, as it's the follow up of STATUS_LOGON_FAILURE when the wrong password was used too often.

Finally if we get -EACCES for a session setup on a soft mount, we'll turn the session into a CifsInvalidCredentials state and return -EKEYREVOKED for all i/o on the session, without trying to reconnect the network connection.

In future we could add ways to recover such sessions. cifs_demultiplex_thread() is already prepared for that. I tested this with a trivial /proc/fs/cifs/ResetInvalidCredentials to reset all sessions, but I don't think that's something that should be used in production.

For now the only way out is 'umount' (as before).

metze