From nobody Mon Sep 17 00:00:00 2001 From: Chuck Date: Thu, 29 Jun 2006 19:22:24 -0400 Subject: [PATCH] [UBUNTU: CIFS] Fix suspend/resume problem which causes EIO on subsequent access to Fixes suspend/resume problem with causes EIO on subsequent access to the mount. http://bugme.osdl.org/show_bug.cgi?id=6632 Upstream: v2.6.17 Closes: #42583. Signed-off-by: Chuck Short --- fs/cifs/cifsfs.c | 2 +- fs/cifs/connect.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) ffb3a186eaf05e8cb05b08b161990003533871d2 diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 2a13a2b..6f5562e 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -909,7 +909,7 @@ static int cifs_dnotify_thread(void * du dnotifyThread = current; do { - if(try_to_freeze()) + if (try_to_freeze()) continue; set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(15*HZ); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c467de8..5f9e728 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -360,23 +360,23 @@ cifs_demultiplex_thread(struct TCP_Serve while (server->tcpStatus != CifsExiting) { if (try_to_freeze()) continue; - if (bigbuf == NULL) { + if (!bigbuf) { bigbuf = cifs_buf_get(); if(bigbuf == NULL) { - cERROR(1,("No memory for large SMB response")); + cERROR(1, ("No memory for large SMB response")); msleep(3000); /* retry will check if exiting */ continue; } - } else if(isLargeBuf) { + } else if (isLargeBuf) { /* we are reusing a dirtry large buf, clear its start */ memset(bigbuf, 0, sizeof (struct smb_hdr)); } if (smallbuf == NULL) { smallbuf = cifs_small_buf_get(); - if(smallbuf == NULL) { - cERROR(1,("No memory for SMB response")); + if(!smallbuf) { + cERROR(1, ("No memory for SMB response")); msleep(1000); /* retry will check if exiting */ continue; @@ -396,12 +396,12 @@ cifs_demultiplex_thread(struct TCP_Serve kernel_recvmsg(csocket, &smb_msg, &iov, 1, 4, 0 /* BB see socket.h flags */); - if(server->tcpStatus == CifsExiting) { + if (server->tcpStatus == CifsExiting) { break; } else if (server->tcpStatus == CifsNeedReconnect) { - cFYI(1,("Reconnect after server stopped responding")); + cFYI(1, ("Reconnect after server stopped responding")); cifs_reconnect(server); - cFYI(1,("call to reconnect done")); + cFYI(1, ("call to reconnect done")); csocket = server->ssocket; continue; } else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) { @@ -410,7 +410,7 @@ cifs_demultiplex_thread(struct TCP_Serve tcpStatus CifsNeedReconnect if server hung */ continue; } else if (length <= 0) { - if(server->tcpStatus == CifsNew) { + if (server->tcpStatus == CifsNew) { cFYI(1,("tcp session abend after SMBnegprot")); /* some servers kill the TCP session rather than returning an SMB negprot error, in which @@ -418,7 +418,7 @@ cifs_demultiplex_thread(struct TCP_Serve and so simply return error to mount */ break; } - if(length == -EINTR) { + if(!try_to_freeze() && (length == -EINTR) { cFYI(1,("cifsd thread killed")); break; } -- 1.3.3