OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [PATCH 1/4] virtio-blk: clarify behavior for writes beyond capacity


Mandate the behavior of the device, and only recomment that the driver
be careful.  It is too optimistic to assume that all drivers will
check for bounds (and also to assume that they will do so correctly).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 content.tex | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/content.tex b/content.tex
index be18234..4cdfeef 100644
--- a/content.tex
+++ b/content.tex
@@ -3759,7 +3759,7 @@ error or VIRTIO_BLK_S_UNSUPP for a request unsupported by device:
 
 \drivernormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
-A driver MUST NOT submit a request which would cause a read or write
+A driver SHOULD NOT submit a request which would cause a read or write
 beyond \field{capacity}.
 
 A driver SHOULD accept the VIRTIO_BLK_F_RO feature if offered.
@@ -3779,6 +3779,9 @@ a range of sectors has been discarded.
 
 \devicenormative{\subsubsection}{Device Operation}{Device Types / Block Device / Device Operation}
 
+A device MUST set the \field{status} byte to VIRTIO_BLK_S_IOERR for a
+request which would cause a read or write beyond \field{capacity}.
+
 A device MUST set the \field{status} byte to VIRTIO_BLK_S_IOERR
 for a write request if the VIRTIO_BLK_F_RO feature if offered, and MUST NOT
 write any data.
-- 
2.17.1




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]