From: gilad@benyossef.com (Gilad Ben-Yossef)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v2 01/11] crypto: introduce crypto wait for async op
Date: Sat, 10 Jun 2017 11:05:39 +0300 [thread overview]
Message-ID: <CAOtvUMeRtcVcp8HE9oJAkJO35yF9XBsry3tdNQYj-e31DnDFQQ@mail.gmail.com> (raw)
In-Reply-To: <20170610034336.GB14206@gondor.apana.org.au>
On Sat, Jun 10, 2017 at 6:43 AM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> 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.
You are right, of course. I did not take that into account.
>
> 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?
I guess there is a question if it really is important to know that
your request ended up
on the backlog, rather than being handled.I can imagine it can be used
as back pressure
indication but I wonder if someone is using that.
If not, maybe we can simplify things and use EINPROGRESS asindication
of a request
being accepted by the next layer (either being processed or queued in
the back log), whereas
EBUSY would indicate failure.
It does have a potential to make things simpler, I think.
Gilad
>
> 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
--
Gilad Ben-Yossef
Chief Coffee Drinker
"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
-- Jean-Baptiste Queru
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-10 8:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 8:22 [PATCH v2 00/11] introduce crypto wait for async op Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 01/11] crypto: " Gilad Ben-Yossef
2017-06-10 3:43 ` Herbert Xu
2017-06-10 8:05 ` Gilad Ben-Yossef [this message]
2017-06-10 9:01 ` Herbert Xu
2017-05-29 8:22 ` [PATCH v2 02/11] crypto: move algif to generic async completion Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 03/11] crypto: move pub key " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 04/11] crypto: move drbg " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 05/11] crypto: move gcm " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 06/11] crypto: move testmgr " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 07/11] dm: move dm-verity " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 08/11] fscrypt: move " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 09/11] cifs: " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 10/11] ima: " Gilad Ben-Yossef
2017-05-29 8:22 ` [PATCH v2 11/11] crypto: adapt api sample to use async. op wait Gilad Ben-Yossef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOtvUMeRtcVcp8HE9oJAkJO35yF9XBsry3tdNQYj-e31DnDFQQ@mail.gmail.com \
--to=gilad@benyossef.com \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).