On Wed, 19 Oct 2011 13:57:55 +0400 Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote: > 2011/10/19 Pavel Shilovsky <piastryyy@xxxxxxxxx>: > > 2011/10/19 Steve French <smfrench@xxxxxxxxx>: > >> If the session could continue after an incorrect checksum (ie retry > >> the operation > >> that failed due to the network error/corruption) > >> then there would be significant advantage in not taking the session down. > >> In practice would that request time out and get killed and retried? > > > > As cifs_check_receive doesn't return any error if checksum doesn't > > match the original, readpages continues the read-ahead process and > > nothing else happens (I mean the request isn't time out, get killed > > and retried). > > > > So, if we don't kill the session in this case, we can simply return > > -EAGAIN and let the calling routine retry the operation itself. > > Thoughts? > > I tried this patch and it works good to me: > > diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c > index 33a3fbf..b54a631 100644 > --- a/fs/cifs/transport.c > +++ b/fs/cifs/transport.c > @@ -508,8 +508,10 @@ cifs_check_receive(struct mid_q_entry *mid, > struct TCP_Server_Info *server, > iov.iov_len = len; > /* FIXME: add code to kill session */ > if (cifs_verify_signature(&iov, 1, server, > - mid->sequence_number + 1) != 0) > + mid->sequence_number + 1) != 0) { > cERROR(1, "Unexpected SMB signature"); > + return -EAGAIN; > + } > } > > /* BB special case reconnect tid and uid here? */ > > > I also applied almost the same patch (that includes the fix for > cifs_readv_callback) to Jeff's async read patchset , fixed the > problems with the error handling in cifs_readv_complete (I posted them > to the list) and got the same good result. > My concern here would be that this could continuously loop if there were a persistent problem with the signature. I'd suggest that we do abort the connection after a certain number of signature check failures on a socket (5? 10?). -- 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