Skip to content

btrfs-progs: receive: fix a silent data loss bug with encoded writes

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs-progs: receive: add debug messages when processing encoded writescmds/receive.c+11 -01 reply
2/3btrfs-progs: receive: add debug messages when processing fallocatecmds/receive.c+5 -01 reply
3/3btrfs-progs: receive: fix silent data loss after fall back from encoded writecmds/receive.c+8 -71 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchBoris Burkov
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs-progs: receive: fix a silent data loss bug with encoded writes

From: Filipe Manana <[email protected]>

When using a v2 stream, with encoded writes, if the receiver fails to perform an encoded write, it fallbacks to decompressing the data and then write it using regular buffered IO. However that logic is currenty buggy, and it can result in writing less data than expected or no data at all. This results in a silent data loss.

Patch 3/3 fixes that bug and has all the details about how/why it happens, while previous patches just added debug messages to the callbacks for encoded writes and fallocate, which are currently missing and are very useful for debugging.

Filipe Manana (3):
btrfs-progs: receive: add debug messages when processing encoded writes
btrfs-progs: receive: add debug messages when processing fallocate
btrfs-progs: receive: fix silent data loss after fall back from encoded write

 cmds/receive.c | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)
Signature · 1 line
2.35.1