From 53e80143697adb45b5e40a62c78e99c342503c53 Mon Sep 17 00:00:00 2001 From: Alexander Kovtunenko Date: Mon, 15 Oct 2018 16:02:11 +0300 Subject: [PATCH] btrfs-progs: receive: set up max_errors count The command $ printf 'btrfs-stream\0\0\0\0\0' | btrfs receive --dump can loop as the stream is not valid, but the maximum error limit is not set properly for --dump. The command line parameter -E applies here too, so it's still possible to dump partially damanged stream. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200085 Author: Alexander Kovtunenko Signed-off-by: David Sterba --- cmds-receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-receive.c b/cmds-receive.c index 2b52071b..fe5c3a5b 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -1347,7 +1347,7 @@ int cmd_receive(int argc, char **argv) dump_args.full_subvol_path[0] = '.'; dump_args.full_subvol_path[1] = '\0'; ret = btrfs_read_and_process_send_stream(receive_fd, - &btrfs_print_send_ops, &dump_args, 0, 0); + &btrfs_print_send_ops, &dump_args, 0, max_errors); if (ret < 0) { errno = -ret; error("failed to dump the send stream: %m");