diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-12-27 07:23:34 -0500 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-24 13:54:59 -0400 |
commit | aa24d1e9692411e605084938ced6b160f92df454 (patch) | |
tree | 399446513c2437af67ca8ed065ba16f272715bb4 /fs/cifs/cifssmb.c | |
parent | faaf946a7d5b79194358437150f34ab4c66bfe21 (diff) |
CIFS: Process reconnects for SMB2 shares
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index dcb0ad87e173..f1dfc7844f1b 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -112,24 +112,29 @@ cifs_kmap_unlock(void) | |||
112 | #define cifs_kmap_unlock() do { ; } while(0) | 112 | #define cifs_kmap_unlock() do { ; } while(0) |
113 | #endif /* CONFIG_HIGHMEM */ | 113 | #endif /* CONFIG_HIGHMEM */ |
114 | 114 | ||
115 | /* Mark as invalid, all open files on tree connections since they | 115 | /* |
116 | were closed when session to server was lost */ | 116 | * Mark as invalid, all open files on tree connections since they |
117 | static void mark_open_files_invalid(struct cifs_tcon *pTcon) | 117 | * were closed when session to server was lost. |
118 | */ | ||
119 | void | ||
120 | cifs_mark_open_files_invalid(struct cifs_tcon *tcon) | ||
118 | { | 121 | { |
119 | struct cifsFileInfo *open_file = NULL; | 122 | struct cifsFileInfo *open_file = NULL; |
120 | struct list_head *tmp; | 123 | struct list_head *tmp; |
121 | struct list_head *tmp1; | 124 | struct list_head *tmp1; |
122 | 125 | ||
123 | /* list all files open on tree connection and mark them invalid */ | 126 | /* list all files open on tree connection and mark them invalid */ |
124 | spin_lock(&cifs_file_list_lock); | 127 | spin_lock(&cifs_file_list_lock); |
125 | list_for_each_safe(tmp, tmp1, &pTcon->openFileList) { | 128 | list_for_each_safe(tmp, tmp1, &tcon->openFileList) { |
126 | open_file = list_entry(tmp, struct cifsFileInfo, tlist); | 129 | open_file = list_entry(tmp, struct cifsFileInfo, tlist); |
127 | open_file->invalidHandle = true; | 130 | open_file->invalidHandle = true; |
128 | open_file->oplock_break_cancelled = true; | 131 | open_file->oplock_break_cancelled = true; |
129 | } | 132 | } |
130 | spin_unlock(&cifs_file_list_lock); | 133 | spin_unlock(&cifs_file_list_lock); |
131 | /* BB Add call to invalidate_inodes(sb) for all superblocks mounted | 134 | /* |
132 | to this tcon */ | 135 | * BB Add call to invalidate_inodes(sb) for all superblocks mounted |
136 | * to this tcon. | ||
137 | */ | ||
133 | } | 138 | } |
134 | 139 | ||
135 | /* reconnect the socket, tcon, and smb session if needed */ | 140 | /* reconnect the socket, tcon, and smb session if needed */ |
@@ -209,7 +214,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) | |||
209 | goto out; | 214 | goto out; |
210 | } | 215 | } |
211 | 216 | ||
212 | mark_open_files_invalid(tcon); | 217 | cifs_mark_open_files_invalid(tcon); |
213 | rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); | 218 | rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); |
214 | mutex_unlock(&ses->session_mutex); | 219 | mutex_unlock(&ses->session_mutex); |
215 | cFYI(1, "reconnect tcon rc = %d", rc); | 220 | cFYI(1, "reconnect tcon rc = %d", rc); |