Re: [PATCH 2/2] cifs: clarify the meaning of tcpStatus == CifsGood

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 Feb 2011 17:50:33 -0600
Steve French <smfrench@xxxxxxxxx> wrote:

> I discussed a simpler alternative with Jeff today.
> maxBuf is set by SMB Negotiate Protocol, and when
> reconnecting is reset to zero to indicate
> that Negotiate Protocol needs to be done, so it
> is a smaller patch to just check that
> (we could eliminate the tcpStatus == CifsGood check
> as well, but it is harmless and as it was tested/works
> I lean toward simply leaving that in, and adding
> the most trivial change).  See below:
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 257b6d8..10011e9 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -341,7 +341,7 @@ cifs_echo_request(struct work_struct *work)
>  	 * We cannot send an echo until the NEGOTIATE_PROTOCOL request is done.
>  	 * Also, no need to ping if we got a response recently
>  	 */
> -	if (server->tcpStatus != CifsGood ||
> +	if ((server->tcpStatus != CifsGood) || (server->maxBuf == 0) ||
>  	    time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))
>  		goto requeue_echo;
> 

It's a reasonable fix that should work. I think we should remove the
check for tcpStatus != CifsGood since it's meaningless. I'd also like
to see the comment altered to mention why you're checking for
maxBuf == 0 as it's not at all obvious.

-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux