All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label
@ 2017-01-13  3:02 Li Qiang
  2017-01-13  9:00 ` Xiao Guangrong
  0 siblings, 1 reply; 4+ messages in thread
From: Li Qiang @ 2017-01-13  3:02 UTC (permalink / raw)
  To: guangrong.xiao, qemu-devel; +Cc: Li Qiang

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-16 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13  3:02 [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label Li Qiang
2017-01-13  9:00 ` Xiao Guangrong
2017-01-14 11:22   ` Li Qiang
2017-01-16 13:34     ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.