Thread (62 messages) 62 messages, 2 authors, 2022-01-04

Re: [PATCH v11 03/10] btrfs-progs: receive: support v2 send stream DATA tlv format

From: Nikolay Borisov <hidden>
Date: 2021-10-20 14:36:06
Also in: linux-btrfs, linux-fsdevel


On 1.09.21 г. 20:01, Omar Sandoval wrote:
From: Boris Burkov <redacted>

The new format privileges the BTRFS_SEND_A_DATA attribute by
guaranteeing it will always be the last attribute in any command that
needs it, and by implicitly encoding the data length as the difference
between the total command length in the command header and the sizes of
the rest of the attributes (and of course the tlv_type identifying the
DATA attribute). To parse the new stream, we must read the tlv_type and
if it is not DATA, we proceed normally, but if it is DATA, we don't
parse a tlv_len but simply compute the length.

In addition, we add some bounds checking when parsing each chunk of
data, as well as for the tlv_len itself.

Signed-off-by: Boris Burkov <redacted>
Reviewed-by: Nikolay Borisov <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help