qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: guangrong.xiao@linux.intel.com, qemu-devel@nongnu.org
Cc: Li Qiang <liqiang6-s@360.cn>
Subject: [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label
Date: Thu, 12 Jan 2017 19:02:20 -0800	[thread overview]
Message-ID: <5878435d.54b31c0a.39a7b.4e93@mx.google.com> (raw)

From: Li Qiang <liqiang6-s@360.cn>

The spec doesn't say the namespace label can't be zero
when read/write it. As this is no harmful, just allow
it.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
---
 hw/mem/nvdimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index db896b0..4042097 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -114,7 +114,7 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
 static void nvdimm_validate_rw_label_data(NVDIMMDevice *nvdimm, uint64_t size,
                                         uint64_t offset)
 {
-    assert((nvdimm->label_size >= size + offset) && (offset + size > offset));
+    assert((nvdimm->label_size >= size + offset) && (offset + size >= offset));
 }
 
 static void nvdimm_read_label_data(NVDIMMDevice *nvdimm, void *buf,
-- 
1.8.3.1

             reply	other threads:[~2017-01-13  3:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  3:02 Li Qiang [this message]
2017-01-13  9:00 ` [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label Xiao Guangrong
2017-01-14 11:22   ` Li Qiang
2017-01-16 13:34     ` Stefan Hajnoczi

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=5878435d.54b31c0a.39a7b.4e93@mx.google.com \
    --to=liq3ea@gmail.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=liqiang6-s@360.cn \
    --cc=qemu-devel@nongnu.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).