]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: change transient busy return code to -ENOSPC
authorGilad Ben-Yossef <gilad@benyossef.com>
Wed, 18 Oct 2017 07:00:33 +0000 (08:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Nov 2017 14:11:16 +0000 (22:11 +0800)
commitcd022703760a0af8dda0a1ea5bdce23df0fb3eb0
tree6f4725c6a0ac6c093a1f6dc4077fb40865cf3882
parent776189638b174378c59db93d3bcc7a422f2d1277
crypto: change transient busy return code to -ENOSPC

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
failed due to the transformation provider being transiently busy
to -ENOSPC.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c
crypto/cryptd.c