lkml.org 
[lkml]   [2021]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.10 045/152] dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq
Hi!

> > > -static void crypt_alloc_req_aead(struct crypt_config *cc,
> > > +static int crypt_alloc_req_aead(struct crypt_config *cc,
> > > struct convert_context *ctx)
> > > {
> > > - if (!ctx->r.req_aead)
> > > - ctx->r.req_aead = mempool_alloc(&cc->req_pool, GFP_NOIO);
> > > + if (!ctx->r.req) {
> > > + ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
> > > + if (!ctx->r.req)
> > > + return -ENOMEM;
> > > + }
> >
> > But this one can't be good. We are now allocating different field in
> > the structure!
>
> Good catch! Sorry for the copy-paste. It is actually not a big deal,
> because this is not a structure, but a union:
> as long as the mempool was initialized with the correct size, it
> should be no different.

Ah. I actually thought about unions and went back to definition to see
if it is one, but was somehow blind for the moment.

Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-01-19 00:45    [W:0.127 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site