Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662865

Re: [PATCH v2 01/11] crypto: introduce crypto wait for async op

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH v2 01/11] crypto: introduce crypto wait for async op
Date 2017-06-10 05:50 +0200
Message-ID <tQFzr-1TZ-7@gated-at.bofh.it> (permalink)
References <tModP-5Cf-5@gated-at.bofh.it> <tModR-5Cf-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 29, 2017 at 11:22:48AM +0300, Gilad Ben-Yossef wrote:
>
> +static inline int crypto_wait_req(int err, struct crypto_wait *wait)
> +{
> +	switch (err) {
> +	case -EINPROGRESS:
> +	case -EBUSY:
> +		wait_for_completion(&wait->completion);
> +		reinit_completion(&wait->completion);
> +		err = wait->err;
> +		break;
> +	};
> +
> +	return err;
> +}

This assumes that the request is used with backlog.  For non-backlog
requests this would result in a memory leak as EBUSY in that case is
a fatal error.

So this API can't be used without backlog.

We could introduce a flag to indicate whether we want backlog or not,
or maybe we should change our API so that in the non-backlog case we
return something other than EBUSY.

Opinions?

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 01/11] crypto: introduce crypto wait for async op Herbert Xu <herbert@gondor.apana.org.au> - 2017-06-10 05:50 +0200
  Re: [PATCH v2 01/11] crypto: introduce crypto wait for async op Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-10 10:10 +0200
    Re: [PATCH v2 01/11] crypto: introduce crypto wait for async op Herbert Xu <herbert@gondor.apana.org.au> - 2017-06-10 11:10 +0200

csiph-web