From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: Puranjay Mohan <pjy@amazon.com>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
puranjay@kernel.org
Subject: Re: [PATCH v2] nvme: check if the namespace supports metadata in nvme_map_user_request()
Date: Thu, 29 Aug 2024 06:28:14 +0200 [thread overview]
Message-ID: <20240829042814.GA4644@lst.de> (raw)
In-Reply-To: <Zs8360kRPGa1B5xy@kbusch-mbp>
On Wed, Aug 28, 2024 at 08:44:59AM -0600, Keith Busch wrote:
> On Tue, Aug 27, 2024 at 01:23:27PM +0000, Puranjay Mohan wrote:
> > @@ -119,9 +120,13 @@ static int nvme_map_user_request(struct request *req, u64 ubuffer,
> > struct request_queue *q = req->q;
> > struct nvme_ns *ns = q->queuedata;
> > struct block_device *bdev = ns ? ns->disk->part0 : NULL;
> > + bool has_metadata = bdev && meta_buffer && meta_len;
>
> If this is an admin command, then bdev is NULL, so "has_metadata" is
> false.
>
> Since has_metadata is false, we continue on to process this admin
> command, but ignore the user's metadata settings. Do we want to return
> error there too?
Ah yes. I had my brain wrapped around this the wrong way the
entire time.
Maybe a
bool supports_metadata = bdev && blk_get_integrity(bdev->bd_disk);
bool has_metadata = meta_buffer && meta_len;
might help poor brains like mine.
prev parent reply other threads:[~2024-08-29 4:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240828095322epcas5p134935f60a199bc085198b06871cd33ba@epcas5p1.samsung.com>
2024-08-27 13:23 ` [PATCH v2] nvme: check if the namespace supports metadata in nvme_map_user_request() Puranjay Mohan
2024-08-28 4:28 ` Christoph Hellwig
2024-08-28 7:21 ` Sagi Grimberg
2024-08-28 9:45 ` Anuj Gupta
2024-08-28 14:44 ` [PATCH v2] " Keith Busch
2024-08-28 15:31 ` Puranjay Mohan
2024-08-28 15:52 ` Keith Busch
2024-08-29 4:28 ` Christoph Hellwig [this message]
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=20240829042814.GA4644@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=pjy@amazon.com \
--cc=puranjay@kernel.org \
--cc=sagi@grimberg.me \
/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