Commit 9971a741 authored by Boris Burkov's avatar Boris Burkov Committed by David Sterba

btrfs: send: allow protocol version 3 with CONFIG_BTRFS_DEBUG

We haven't finalized send stream v3 yet, so gate the send stream version
behind CONFIG_BTRFS_DEBUG as we want some way to test it.

The original verity send did not check the protocol version, so add that
actual protection as well.
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarBoris Burkov <boris@bur.io>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 96dbcc00
...@@ -6469,7 +6469,7 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end) ...@@ -6469,7 +6469,7 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end)
if (ret < 0) if (ret < 0)
goto out; goto out;
} }
if (sctx->cur_inode_needs_verity) { if (sctx->proto >= 3 && sctx->cur_inode_needs_verity) {
ret = process_verity(sctx); ret = process_verity(sctx);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -10,7 +10,12 @@ ...@@ -10,7 +10,12 @@
#include <linux/types.h> #include <linux/types.h>
#define BTRFS_SEND_STREAM_MAGIC "btrfs-stream" #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
/* Conditional support for the upcoming protocol version. */
#ifdef CONFIG_BTRFS_DEBUG
#define BTRFS_SEND_STREAM_VERSION 3
#else
#define BTRFS_SEND_STREAM_VERSION 2 #define BTRFS_SEND_STREAM_VERSION 2
#endif
/* /*
* In send stream v1, no command is larger than 64K. In send stream v2, no limit * In send stream v1, no command is larger than 64K. In send stream v2, no limit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment