Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Michael Mol <mikemol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cifs: on send failure, readjust server sequence number downward
Date: Wed, 03 Apr 2013 14:54:42 -0400	[thread overview]
Message-ID: <515C7AF2.3090902@gmail.com> (raw)
In-Reply-To: <1365012430-6795-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2648 bytes --]

On 04/03/2013 02:07 PM, Jeff Layton wrote:
> If sending a call to the server fails for some reason (for instance, the
> sending thread caught a signal), then we must readjust the sequence
> number downward again or the next send will have it too high.
> 
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/smb1ops.c   |  3 +++
>  fs/cifs/transport.c | 13 +++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
> index 23bcd11..3efdb9d 100644
> --- a/fs/cifs/smb1ops.c
> +++ b/fs/cifs/smb1ops.c
> @@ -61,6 +61,9 @@ send_nt_cancel(struct TCP_Server_Info *server, void *buf,
>  	 */
>  	--server->sequence_number;
>  	rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
> +	if (rc < 0)
> +		server->sequence_number--;
> +
>  	mutex_unlock(&server->srv_mutex);
>  
>  	cifs_dbg(FYI, "issued NT_CANCEL for mid %u, rc = %d\n",
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 653bf26..293d2c8 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -522,6 +522,9 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_rqst *rqst,
>  	rc = smb_send_rqst(server, rqst);
>  	cifs_in_send_dec(server);
>  	cifs_save_when_sent(mid);
> +
> +	if (rc < 0)
> +		server->sequence_number -= 2;
>  	mutex_unlock(&server->srv_mutex);
>  
>  	if (rc == 0)
> @@ -711,6 +714,8 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
>  	cifs_in_send_dec(ses->server);
>  	cifs_save_when_sent(midQ);
>  
> +	if (rc < 0)
> +		ses->server->sequence_number -= 2;
>  	mutex_unlock(&ses->server->srv_mutex);
>  
>  	if (rc < 0) {
> @@ -835,6 +840,10 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
>  	rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
>  	cifs_in_send_dec(ses->server);
>  	cifs_save_when_sent(midQ);
> +
> +	if (rc < 0)
> +		ses->server->sequence_number -= 2;
> +
>  	mutex_unlock(&ses->server->srv_mutex);
>  
>  	if (rc < 0)
> @@ -968,6 +977,10 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
>  	rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
>  	cifs_in_send_dec(ses->server);
>  	cifs_save_when_sent(midQ);
> +
> +	if (rc < 0)
> +		ses->server->sequence_number -= 2;
> +
>  	mutex_unlock(&ses->server->srv_mutex);
>  
>  	if (rc < 0) {
> 

I was re-prioritized...I'll test the patches you'd like me to test just
as soon as I can. At that point, I'll prod the list and ask for an
up-to-date list of the patchset you'd like me to try.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]

  parent reply	other threads:[~2013-04-03 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 18:07 [PATCH] cifs: on send failure, readjust server sequence number downward Jeff Layton
     [not found] ` <1365012430-6795-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-03 18:54   ` Michael Mol [this message]
     [not found]     ` <515C7AF2.3090902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-04-03 19:02       ` Jeff Layton
     [not found]         ` <20130403150227.25f37cce-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-04-22 21:17           ` Michael Mol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515C7AF2.3090902@gmail.com \
    --to=mikemol-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox