Re: [PATCH] nvme: check if the namespace supports metadata in nvme_map_user_request()
From: Christoph Hellwig
Date: Wed Aug 28 2024 - 00:29:24 EST
On Tue, Aug 27, 2024 at 09:42:08AM -0600, Keith Busch wrote:
> On Tue, Aug 27, 2024 at 12:17:01PM +0000, Puranjay Mohan wrote:
> > @@ -122,6 +123,9 @@ static int nvme_map_user_request(struct request *req, u64 ubuffer,
> > struct bio *bio = NULL;
> > int ret;
> >
> > + if (meta_buffer && meta_len && bdev && !blk_get_integrity(bdev->bd_disk))
> > + return -EINVAL;
> > +
>
> Should we also fail if there's no bdev? The driver won't use the
> requested metadata for admin commands either, so that is also an invalid
> user request.
Yes, the last version gets the right.