Blame SOURCES/1113-btrfs-progs-receive-add-debug-messages-when-processi.patch

Boris Burkov 40ef45
From 4e6d18589dc8cba4c8414a2f03c14c31bd400a6c Mon Sep 17 00:00:00 2001
Boris Burkov 40ef45
Message-Id: <4e6d18589dc8cba4c8414a2f03c14c31bd400a6c.1668799549.git.boris@bur.io>
Boris Burkov 40ef45
In-Reply-To: <cover.1668799549.git.boris@bur.io>
Boris Burkov 40ef45
References: <cover.1668799549.git.boris@bur.io>
Boris Burkov 40ef45
From: Filipe Manana <fdmanana@suse.com>
Boris Burkov 40ef45
Date: Tue, 15 Nov 2022 16:25:25 +0000
Boris Burkov 40ef45
Subject: [PATCH 2/3] btrfs-progs: receive: add debug messages when processing
Boris Burkov 40ef45
 fallocate
Boris Burkov 40ef45
Boris Burkov 40ef45
Unlike for commands from the v1 stream, we have no debug messages logged
Boris Burkov 40ef45
when processing fallocate commands, which makes it harder to debug issues.
Boris Burkov 40ef45
Boris Burkov 40ef45
So add log messages, when the log verbosity level is >= 3, for fallocate
Boris Burkov 40ef45
commands, mentioning the value of all fields.
Boris Burkov 40ef45
Boris Burkov 40ef45
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Boris Burkov 40ef45
Reviewed-by: Boris Burkov <boris@bur.io>
Boris Burkov 40ef45
---
Boris Burkov 40ef45
 cmds/receive.c | 5 +++++
Boris Burkov 40ef45
 1 file changed, 5 insertions(+)
Boris Burkov 40ef45
Boris Burkov 40ef45
diff --git a/cmds/receive.c b/cmds/receive.c
Boris Burkov 40ef45
index ce615e7c..9f73b072 100644
Boris Burkov 40ef45
--- a/cmds/receive.c
Boris Burkov 40ef45
+++ b/cmds/receive.c
Boris Burkov 40ef45
@@ -1296,6 +1296,11 @@ static int process_fallocate(const char *path, int mode, u64 offset, u64 len,
Boris Burkov 40ef45
 	struct btrfs_receive *rctx = user;
Boris Burkov 40ef45
 	char full_path[PATH_MAX];
Boris Burkov 40ef45
 
Boris Burkov 40ef45
+	if (bconf.verbose >= 3)
Boris Burkov 40ef45
+		fprintf(stderr,
Boris Burkov 40ef45
+			"fallocate %s - offset=%llu, len=%llu, mode=%d\n",
Boris Burkov 40ef45
+			path, offset, len, mode);
Boris Burkov 40ef45
+
Boris Burkov 40ef45
 	ret = path_cat_out(full_path, rctx->full_subvol_path, path);
Boris Burkov 40ef45
 	if (ret < 0) {
Boris Burkov 40ef45
 		error("fallocate: path invalid: %s", path);
Boris Burkov 40ef45
-- 
Boris Burkov 40ef45
2.38.1
Boris Burkov 40ef45