• Gilad Ben-Yossef's avatar
    crypto: change transient busy return code to -ENOSPC · 6b80ea38
    Gilad Ben-Yossef authored
    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: default avatarGilad Ben-Yossef <gilad@benyossef.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    6b80ea38
algapi.c 22.1 KB