path: root/send-stream.h
diff options
authorFilipe David Borba Manana <>2014-05-23 20:14:56 +0100
committerDavid Sterba <>2014-08-22 14:39:32 +0200
commit909131939f750faffb9fab5542c94f14475379f6 (patch)
tree62b2553a2961e7c376337ab1bbba87945fd520dc /send-stream.h
parentc2429c8a0d34ab47e69c8e66803ad4112ff31985 (diff)
Btrfs-progs: receive, allow to continue after errors happen
Due to either bugs in send (kernel) that generate a command against a wrong path for example, or transient errors on the receiving side, we stopped processing the send stream immediately and exited with an error. It's often desirable to continue processing the send stream even if an error happens while processing a single command from the send stream. This change just adds a --max-errors <N> parameter, whose default value is 1 (preserving current behaviour), that allows to tolerate N errors before stopping. A value of 0 means to never stop no matter how many errors we get into while processing the send stream. Regardless of its value, errors are always printed to stderr when they happen, just like before this change. Signed-off-by: Filipe David Borba Manana <> Signed-off-by: David Sterba <>
Diffstat (limited to 'send-stream.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/send-stream.h b/send-stream.h
index 17bc6692..293bf6af 100644
--- a/send-stream.h
+++ b/send-stream.h
@@ -58,7 +58,8 @@ struct btrfs_send_ops {
int btrfs_read_and_process_send_stream(int fd,
struct btrfs_send_ops *ops, void *user,
- int honor_end_cmd);
+ int honor_end_cmd,
+ u64 max_errors);
#ifdef __cplusplus