Skip to content

Commit 9971a74

Browse files
boryaskdave
authored andcommitted
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: Anand Jain <[email protected]> Signed-off-by: Boris Burkov <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 96dbcc0 commit 9971a74

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

fs/btrfs/send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6469,7 +6469,7 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end)
64696469
if (ret < 0)
64706470
goto out;
64716471
}
6472-
if (sctx->cur_inode_needs_verity) {
6472+
if (sctx->proto >= 3 && sctx->cur_inode_needs_verity) {
64736473
ret = process_verity(sctx);
64746474
if (ret < 0)
64756475
goto out;

fs/btrfs/send.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
#include <linux/types.h>
1111

1212
#define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
13+
/* Conditional support for the upcoming protocol version. */
14+
#ifdef CONFIG_BTRFS_DEBUG
15+
#define BTRFS_SEND_STREAM_VERSION 3
16+
#else
1317
#define BTRFS_SEND_STREAM_VERSION 2
18+
#endif
1419

1520
/*
1621
* In send stream v1, no command is larger than 64K. In send stream v2, no limit

0 commit comments

Comments
 (0)