Subject: Re: [PATCH]: Fix networking scatterlist regressions.

From: Jens Axboe <[email-masked]>
Date: Wed, 31 Oct 2007 08:46:21 +0100

On Tue, Oct 30 2007, David Miller wrote:
> diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
> index 91cd8f0..4a8aa94 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
> @@ -211,8 +211,8 @@ encryptor(struct scatterlist *sg, void *data)
>  	if (thislen == 0)
>  		return 0;
>  
> -	sg_mark_end(desc->infrags, desc->fragno);
> -	sg_mark_end(desc->outfrags, desc->fragno);
> +	__sg_mark_end(desc->infrags, desc->fragno);
> +	__sg_mark_end(desc->outfrags, desc->fragno);
>  
>  	ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
>  					  desc->infrags, thislen);
> @@ -293,7 +293,7 @@ decryptor(struct scatterlist *sg, void *data)
>  	if (thislen == 0)
>  		return 0;
>  
> -	sg_mark_end(desc->frags, desc->fragno);
> +	__sg_mark_end(desc->frags, desc->fragno);
>  
>  	ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
>  					  desc->frags, thislen);

Hmm? These don't seem right. It also has a weird code sequence:

...
        sg_mark_end(&desc->infrags[desc->fragno - 1]);
        sg_mark_end(&desc->outfrags[desc->fragno - 1]);

        ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
                                          desc->infrags, thislen);
        if (ret)
                return ret;

        sg_init_table(desc->infrags, 4);
        sg_init_table(desc->outfrags, 4);
...

Did something go wrong there?

-- 
Jens Axboe