Skip to content

Commit c86eab8

Browse files
committed
btrfs: send: update command for protocol version check
For a protocol and command compatibility we have a helper that hasn't been updated for v3 yet. We use it for verity so update where necessary. Fixes: 3862201 ("btrfs: send: add support for fs-verity") Signed-off-by: David Sterba <[email protected]>
1 parent 9971a74 commit c86eab8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/btrfs/send.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ static bool proto_cmd_ok(const struct send_ctx *sctx, int cmd)
348348
switch (sctx->proto) {
349349
case 1: return cmd <= BTRFS_SEND_C_MAX_V1;
350350
case 2: return cmd <= BTRFS_SEND_C_MAX_V2;
351+
case 3: return cmd <= BTRFS_SEND_C_MAX_V3;
351352
default: return false;
352353
}
353354
}
@@ -6469,7 +6470,9 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end)
64696470
if (ret < 0)
64706471
goto out;
64716472
}
6472-
if (sctx->proto >= 3 && sctx->cur_inode_needs_verity) {
6473+
6474+
if (proto_cmd_ok(sctx, BTRFS_SEND_C_ENABLE_VERITY)
6475+
&& sctx->cur_inode_needs_verity) {
64736476
ret = process_verity(sctx);
64746477
if (ret < 0)
64756478
goto out;

0 commit comments

Comments
 (0)