From: Eric Biggers <ebiggers@kernel.org>
To: Nathan Huckleberry <nhuck@google.com>
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
linux-fscrypt@vger.kernel.org, stable@vger.kernel.org,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 1/4] blk-mq: release crypto keyslot before reporting I/O complete
Date: Tue, 14 Mar 2023 11:20:14 -0700 [thread overview]
Message-ID: <ZBC63ry7EFMr+Xzk@sol.localdomain> (raw)
In-Reply-To: <CAJkfWY76-fUf92YZid3bOPrufXwCzM-q9L1ezqkLZ+WJiWL3jQ@mail.gmail.com>
On Mon, Mar 13, 2023 at 02:26:00PM -0700, Nathan Huckleberry wrote:
> > diff --git a/block/blk-merge.c b/block/blk-merge.c
> > index 6460abdb2426..65e75efa9bd3 100644
> > --- a/block/blk-merge.c
> > +++ b/block/blk-merge.c
> > @@ -867,6 +867,8 @@ static struct request *attempt_merge(struct request_queue *q,
> > if (!blk_discard_mergable(req))
> > elv_merge_requests(q, req, next);
> >
> > + blk_crypto_rq_put_keyslot(next);
> > +
>
> This looks good to me, but it looks like there was a pre-existing bug
> in the blk-merge code. The elv_merged_request function is only called
> when the request does not merge. Does anyone know if that behavior is
> correct?
That's very confusing to me too!
I did notice that attempt_merge() calls elv_merge_requests() (not to be confused
with elv_merged_request()) if it merges the requests.
So it seems there is elv_merge_requests() which means the request was merged,
and elv_merged_request() which means the request was *not* merged... I have no
idea what is going on there :-(
> This patch itself looks good to me.
>
> Reviewed-by: Nathan Huckleberry <nhuck@google.com>
Thanks.
Jens, Christoph, etc., anyone else want to take a look too?
- Eric
next prev parent reply other threads:[~2023-03-14 18:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 19:36 [PATCH v2 0/4] Fix blk-crypto keyslot race condition Eric Biggers
2023-03-08 19:36 ` [PATCH v2 1/4] blk-mq: release crypto keyslot before reporting I/O complete Eric Biggers
2023-03-13 21:26 ` Nathan Huckleberry
2023-03-14 18:20 ` Eric Biggers [this message]
2023-03-15 16:18 ` Christoph Hellwig
2023-03-15 16:19 ` Christoph Hellwig
2023-03-08 19:36 ` [PATCH v2 2/4] blk-crypto: make blk_crypto_evict_key() more robust Eric Biggers
2023-03-15 16:23 ` Christoph Hellwig
2023-03-15 18:26 ` Eric Biggers
2023-03-08 19:36 ` [PATCH v2 3/4] blk-crypto: remove blk_crypto_insert_cloned_request() Eric Biggers
2023-03-15 16:24 ` Christoph Hellwig
2023-03-15 18:27 ` Eric Biggers
2023-03-08 19:36 ` [PATCH v2 4/4] blk-crypto: drop the NULL check from blk_crypto_put_keyslot() Eric Biggers
2023-03-15 16:24 ` Christoph Hellwig
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=ZBC63ry7EFMr+Xzk@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=nhuck@google.com \
--cc=stable@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).