aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@suse.de>2006-06-13 17:31:39 -0400
committerSteve French <sfrench@us.ibm.com>2006-06-13 17:31:39 -0400
commit0fd1ffe0633b4b039b343b753598e6df435e034d (patch)
tree2b7aca82f26ed911dd86f47af80456b35ea776b8 /fs/cifs/connect.c
parent6344a423e5806d138923caa1d7699f3b7809fe43 (diff)
[CIFS] Fix suspend/resume problem which causes EIO on subsequent access to
the mount. Signed-off-by: Pavel Machek <pavel@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e6f3d2fff6c0..faaf9eb15b9f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -367,21 +367,21 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
367 continue; 367 continue;
368 if (bigbuf == NULL) { 368 if (bigbuf == NULL) {
369 bigbuf = cifs_buf_get(); 369 bigbuf = cifs_buf_get();
370 if(bigbuf == NULL) { 370 if (!bigbuf) {
371 cERROR(1,("No memory for large SMB response")); 371 cERROR(1, ("No memory for large SMB response"));
372 msleep(3000); 372 msleep(3000);
373 /* retry will check if exiting */ 373 /* retry will check if exiting */
374 continue; 374 continue;
375 } 375 }
376 } else if(isLargeBuf) { 376 } else if (isLargeBuf) {
377 /* we are reusing a dirtry large buf, clear its start */ 377 /* we are reusing a dirty large buf, clear its start */
378 memset(bigbuf, 0, sizeof (struct smb_hdr)); 378 memset(bigbuf, 0, sizeof (struct smb_hdr));
379 } 379 }
380 380
381 if (smallbuf == NULL) { 381 if (smallbuf == NULL) {
382 smallbuf = cifs_small_buf_get(); 382 smallbuf = cifs_small_buf_get();
383 if(smallbuf == NULL) { 383 if (!smallbuf) {
384 cERROR(1,("No memory for SMB response")); 384 cERROR(1, ("No memory for SMB response"));
385 msleep(1000); 385 msleep(1000);
386 /* retry will check if exiting */ 386 /* retry will check if exiting */
387 continue; 387 continue;
@@ -401,12 +401,12 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
401 kernel_recvmsg(csocket, &smb_msg, 401 kernel_recvmsg(csocket, &smb_msg,
402 &iov, 1, 4, 0 /* BB see socket.h flags */); 402 &iov, 1, 4, 0 /* BB see socket.h flags */);
403 403
404 if(server->tcpStatus == CifsExiting) { 404 if (server->tcpStatus == CifsExiting) {
405 break; 405 break;
406 } else if (server->tcpStatus == CifsNeedReconnect) { 406 } else if (server->tcpStatus == CifsNeedReconnect) {
407 cFYI(1,("Reconnect after server stopped responding")); 407 cFYI(1, ("Reconnect after server stopped responding"));
408 cifs_reconnect(server); 408 cifs_reconnect(server);
409 cFYI(1,("call to reconnect done")); 409 cFYI(1, ("call to reconnect done"));
410 csocket = server->ssocket; 410 csocket = server->ssocket;
411 continue; 411 continue;
412 } else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) { 412 } else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) {
@@ -415,15 +415,15 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
415 tcpStatus CifsNeedReconnect if server hung */ 415 tcpStatus CifsNeedReconnect if server hung */
416 continue; 416 continue;
417 } else if (length <= 0) { 417 } else if (length <= 0) {
418 if(server->tcpStatus == CifsNew) { 418 if (server->tcpStatus == CifsNew) {
419 cFYI(1,("tcp session abend after SMBnegprot")); 419 cFYI(1, ("tcp session abend after SMBnegprot"));
420 /* some servers kill the TCP session rather than 420 /* some servers kill the TCP session rather than
421 returning an SMB negprot error, in which 421 returning an SMB negprot error, in which
422 case reconnecting here is not going to help, 422 case reconnecting here is not going to help,
423 and so simply return error to mount */ 423 and so simply return error to mount */
424 break; 424 break;
425 } 425 }
426 if(length == -EINTR) { 426 if (!try_to_freeze() && (length == -EINTR)) {
427 cFYI(1,("cifsd thread killed")); 427 cFYI(1,("cifsd thread killed"));
428 break; 428 break;
429 } 429 }