qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check


From: Klaus Jensen
Subject: Re: [PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check
Date: Tue, 30 Mar 2021 09:24:59 +0200

On Mar 29 19:52, Gollu Appalanaidu wrote:
> On Wed, Mar 24, 2021 at 09:09:01PM +0100, Klaus Jensen wrote:
> > From: Klaus Jensen <k.jensen@samsung.com>
> > 
> > Protection Information can only be enabled if there is at least 8 bytes
> > of metadata.
> > 
> > Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> > ---
> > hw/block/nvme-ns.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
> > index 7f8d139a8663..ca04ee1bacfb 100644
> > --- a/hw/block/nvme-ns.c
> > +++ b/hw/block/nvme-ns.c
> > @@ -394,7 +394,7 @@ static int nvme_ns_check_constraints(NvmeNamespace *ns, 
> > Error **errp)
> >         return -1;
> >     }
> > 
> > -    if (ns->params.pi && !ns->params.ms) {
> > +    if (ns->params.pi && ns->params.ms < 8) {
> and also it is good check that "metadata size" is power of 2 or not?
> 

While I don't expect a lot of real-world devices having metadata sizes
that are not power of twos, there is no requirement in the spec for
that.

And the implementation here also does not require it :)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]