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


Groups > linux.kernel > #1679964

Re: [PATCH v3 01/28] crypto: change backlog return code to -EIOCBQUEUED

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH v3 01/28] crypto: change backlog return code to -EIOCBQUEUED
Date 2017-07-03 14:40 +0200
Message-ID <tZ8NX-1sr-3@gated-at.bofh.it> (permalink)
References <tYOmd-3l0-3@gated-at.bofh.it> <tYOme-3l0-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Jul 02, 2017 at 05:41:43PM +0300, Gilad Ben-Yossef wrote:
> The crypto API was using the -EBUSY return value to indicate
> both a hard failure to submit a crypto operation into a
> transformation provider when the latter was busy and the backlog
> mechanism was not enabled as well as a notification that the operation
> was queued into the backlog when the backlog mechanism was enabled.
> 
> Having the same return code indicate two very different conditions
> depending on a flag is both error prone and requires extra runtime
> check like the following to discern between the cases:
> 
> 	if (err == -EINPROGRESS ||
> 	    (err == -EBUSY && (ahash_request_flags(req) &
> 			       CRYPTO_TFM_REQ_MAY_BACKLOG)))
> 
> This patch changes the return code used to indicate a crypto op
> was queued in the backlog to -EIOCBQUEUED, thus resolving both
> issues.
> 
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>

So you're changing the success case from EBUSY to EIOCBQUEUED.
This results in a lot of churn as you have to change every single
driver and caller.

How about changing the error case to use something other than
EBUSY instead?

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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 01/28] crypto: change backlog return code to -EIOCBQUEUED Gilad Ben-Yossef <gilad@benyossef.com> - 2017-07-02 16:50 +0200
  Re: [PATCH v3 01/28] crypto: change backlog return code to  -EIOCBQUEUED Herbert Xu <herbert@gondor.apana.org.au> - 2017-07-03 14:40 +0200
    Re: [PATCH v3 01/28] crypto: change backlog return code to -EIOCBQUEUED Gilad Ben-Yossef <gilad@benyossef.com> - 2017-07-03 15:30 +0200

csiph-web