From: Hillf Danton <hdanton@sina.com> To: Ignat Korchagin <ignat@cloudflare.com> Cc: dm-crypt@saout.de, dm-devel@redhat.com, snitzer@redhat.com, agk@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [dm-crypt] [PATCH 1/2] dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq Date: Wed, 30 Dec 2020 15:35:57 +0800 [thread overview] Message-ID: <20201230073557.2253-1-hdanton@sina.com> (raw) In-Reply-To: <20201229225714.1580-1-ignat@cloudflare.com> On Tue, 29 Dec 2020 22:57:13 +0000 > > Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues") Looks like a seperate fix to this commit is needed if what can be found at (Subject: [patch 00/12] UBS: Cleanup in_interupt/in_irq/in_atomic() usage) https://lore.kernel.org/lkml/20201014145215.518912759@linutronix.de/ is correct. > Reported-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> > Cc: <stable@vger.kernel.org> # v5.9+ > Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> > --- > drivers/md/dm-crypt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c > index 5f9f9b3a226d..777b5c71a2f7 100644 > --- a/drivers/md/dm-crypt.c > +++ b/drivers/md/dm-crypt.c > @@ -1460,7 +1460,7 @@ static void crypt_alloc_req_skcipher(struct crypt_config *cc, > unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1); > > if (!ctx->r.req) > - ctx->r.req = mempool_alloc(&cc->req_pool, GFP_NOIO); > + ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO); > > skcipher_request_set_tfm(ctx->r.req, cc->cipher_tfm.tfms[key_index]); > > @@ -1477,7 +1477,7 @@ static void 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); > + ctx->r.req_aead = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO); > > aead_request_set_tfm(ctx->r.req_aead, cc->cipher_tfm.tfms_aead[0]); > > -- > 2.20.1 _______________________________________________ dm-crypt mailing list dm-crypt@saout.de https://www.saout.de/mailman/listinfo/dm-crypt
WARNING: multiple messages have this Message-ID (diff)
From: Hillf Danton <hdanton@sina.com> To: Ignat Korchagin <ignat@cloudflare.com> Cc: dm-crypt@saout.de, dm-devel@redhat.com, snitzer@redhat.com, agk@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [dm-devel] [PATCH 1/2] dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq Date: Wed, 30 Dec 2020 15:35:57 +0800 [thread overview] Message-ID: <20201230073557.2253-1-hdanton@sina.com> (raw) In-Reply-To: <20201229225714.1580-1-ignat@cloudflare.com> On Tue, 29 Dec 2020 22:57:13 +0000 > > Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues") Looks like a seperate fix to this commit is needed if what can be found at (Subject: [patch 00/12] UBS: Cleanup in_interupt/in_irq/in_atomic() usage) https://lore.kernel.org/lkml/20201014145215.518912759@linutronix.de/ is correct. > Reported-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> > Cc: <stable@vger.kernel.org> # v5.9+ > Signed-off-by: Ignat Korchagin <ignat@cloudflare.com> > --- > drivers/md/dm-crypt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c > index 5f9f9b3a226d..777b5c71a2f7 100644 > --- a/drivers/md/dm-crypt.c > +++ b/drivers/md/dm-crypt.c > @@ -1460,7 +1460,7 @@ static void crypt_alloc_req_skcipher(struct crypt_config *cc, > unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1); > > if (!ctx->r.req) > - ctx->r.req = mempool_alloc(&cc->req_pool, GFP_NOIO); > + ctx->r.req = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO); > > skcipher_request_set_tfm(ctx->r.req, cc->cipher_tfm.tfms[key_index]); > > @@ -1477,7 +1477,7 @@ static void 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); > + ctx->r.req_aead = mempool_alloc(&cc->req_pool, in_interrupt() ? GFP_ATOMIC : GFP_NOIO); > > aead_request_set_tfm(ctx->r.req_aead, cc->cipher_tfm.tfms_aead[0]); > > -- > 2.20.1 -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2020-12-30 8:22 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-29 22:57 [PATCH 1/2] dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq Ignat Korchagin 2020-12-29 22:57 ` [dm-devel] " Ignat Korchagin 2020-12-29 22:57 ` [dm-crypt] " Ignat Korchagin 2020-12-29 22:57 ` [PATCH 2/2] dm crypt: do not wait for backlogged crypto request completion in softirq Ignat Korchagin 2020-12-29 22:57 ` [dm-devel] " Ignat Korchagin 2020-12-29 22:57 ` [dm-crypt] " Ignat Korchagin 2020-12-30 7:35 ` Hillf Danton [this message] 2020-12-30 7:35 ` [dm-devel] [PATCH 1/2] dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq Hillf Danton 2020-12-30 11:21 ` Ignat Korchagin 2020-12-30 11:21 ` [dm-devel] " Ignat Korchagin 2020-12-30 11:21 ` [dm-crypt] " Ignat Korchagin 2020-12-30 18:11 ` Mikulas Patocka 2020-12-30 18:11 ` [dm-devel] " Mikulas Patocka 2020-12-30 18:11 ` [dm-crypt] " Mikulas Patocka 2020-12-30 21:46 ` Ignat Korchagin 2020-12-30 21:46 ` [dm-devel] " Ignat Korchagin 2020-12-30 21:46 ` [dm-crypt] " Ignat Korchagin
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=20201230073557.2253-1-hdanton@sina.com \ --to=hdanton@sina.com \ --cc=agk@redhat.com \ --cc=dm-crypt@saout.de \ --cc=dm-devel@redhat.com \ --cc=ignat@cloudflare.com \ --cc=linux-kernel@vger.kernel.org \ --cc=snitzer@redhat.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.