Skip to content

Commit 6725f91

Browse files
committed
spec: Relax block status alignment to match existing servers
At least nbdkit 1.42 has several scenarios where it can advertise a minimum block size, but where block status results are not aligned to that size. While most of those instances are bugs fixed in the upcoming 1.44, we have to consider the case when a server advertises an image size which is not a multiple of the minimum block size. The spec is already clear that a server SHOULD advertise aligned sizes, but when it doesn't, the requirement that block status results be aligned is impossible to meet. Relaxing the standard from MUST to SHOULD warns clients to be prepared for weaknesses in the server, as well as making it less troublesome to try and collect block status even for an unaligned tail of an image. Signed-off-by: Eric Blake <[email protected]>
1 parent eaac99e commit 6725f91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/proto.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,8 +2267,10 @@ The following request types exist:
22672267
places for an exception), in part to avoid an amplification effect
22682268
where a series of smaller descriptors can cause the server's reply
22692269
to occupy more bytes than the *length* of the client's request.
2270-
The server MUST use descriptor lengths that are an integer
2271-
multiple of any advertised minimum block size. The status flags
2270+
The server SHOULD use descriptor lengths that are an integer
2271+
multiple of any advertised minimum block size, with an obvious
2272+
exception at the end of the image if the image size itself is
2273+
unaligned. The status flags
22722274
are intentionally defined so that a server MAY always safely
22732275
report a status of 0 for any block, although the server SHOULD
22742276
return additional status values when they can be easily detected.

0 commit comments

Comments
 (0)