diff options
author | Steve French <smfrench@gmail.com> | 2016-09-22 19:23:56 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2016-10-12 12:08:33 -0500 |
commit | 52ace1ef1259e119a24a34b45cb800c4e7529090 (patch) | |
tree | 41f8d27ff08c4086025c5894f2cdcd8ee5f205e6 /fs/cifs/smb2pdu.c | |
parent | 3afca265b5f53a0b15b79531c13858049505582d (diff) | |
download | linux-52ace1ef1259e119a24a34b45cb800c4e7529090.tar.gz linux-52ace1ef1259e119a24a34b45cb800c4e7529090.tar.bz2 linux-52ace1ef1259e119a24a34b45cb800c4e7529090.zip |
fs/cifs: reopen persistent handles on reconnect
Continuous Availability features like persistent handles
require that clients reconnect their open files, not
just the sessions, soon after the network connection comes
back up, otherwise the server will throw away the state
(byte range locks, leases, deny modes) on those handles
after a timeout.
Add code to reconnect handles when use_persistent set
(e.g. Continuous Availability shares) after tree reconnect.
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 3eec96ca87d9..4d944c4c55a8 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -250,8 +250,13 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) } cifs_mark_open_files_invalid(tcon); + rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage); mutex_unlock(&tcon->ses->session_mutex); + + if (tcon->use_persistent) + cifs_reopen_persistent_handles(tcon); + cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc); if (rc) goto out; |