diff options
author | Pavel Machek <pavel@suse.de> | 2006-06-13 17:31:39 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-06-13 17:31:39 -0400 |
commit | 0fd1ffe0633b4b039b343b753598e6df435e034d (patch) | |
tree | 2b7aca82f26ed911dd86f47af80456b35ea776b8 /fs | |
parent | 6344a423e5806d138923caa1d7699f3b7809fe43 (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')
-rw-r--r-- | fs/cifs/cifsfs.c | 2 | ||||
-rw-r--r-- | fs/cifs/connect.c | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 700570522b23..fb7c11c2c913 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -905,7 +905,7 @@ static int cifs_dnotify_thread(void * dummyarg) | |||
905 | struct cifsSesInfo *ses; | 905 | struct cifsSesInfo *ses; |
906 | 906 | ||
907 | do { | 907 | do { |
908 | if(try_to_freeze()) | 908 | if (try_to_freeze()) |
909 | continue; | 909 | continue; |
910 | set_current_state(TASK_INTERRUPTIBLE); | 910 | set_current_state(TASK_INTERRUPTIBLE); |
911 | schedule_timeout(15*HZ); | 911 | schedule_timeout(15*HZ); |
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 | } |