From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f65.google.com ([209.85.214.65]:52813 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932484AbeEICLy (ORCPT ); Tue, 8 May 2018 22:11:54 -0400 Received: by mail-it0-f65.google.com with SMTP id y189-v6so12592543itb.2 for ; Tue, 08 May 2018 19:11:54 -0700 (PDT) From: Howard McLauchlan To: linux-btrfs@vger.kernel.org Cc: Chris Mason , Josef Bacik , David Sterba , Filipe Manana , Omar Sandoval , Filipe Manana Subject: [RFC PATCH 4/6] Btrfs-progs: add write and clone commands debug info to receive Date: Tue, 8 May 2018 22:11:35 -0400 Message-Id: <20180509021137.8342-4-linux@hmclauchlan.com> In-Reply-To: <20180509021137.8342-1-linux@hmclauchlan.com> References: <20180509021137.8342-1-linux@hmclauchlan.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: From: Filipe Manana When specifying -vv print information about received write and clone commands too, as we do this for other commands already and it's very useful for debugging and troubleshooting. Signed-off-by: Filipe David Borba Manana --- cmds-receive.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmds-receive.c b/cmds-receive.c index 510b6bc8..20e593f7 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -790,6 +790,10 @@ static int process_write(const char *path, const void *data, u64 offset, u64 pos = 0; int w; + if (g_verbose >= 2) + fprintf(stderr, "write %s, offset %llu, len %llu\n", + path, offset, len); + ret = path_cat_out(full_path, rctx->full_subvol_path, path); if (ret < 0) { error("write: path invalid: %s", path); @@ -831,6 +835,11 @@ static int process_clone(const char *path, u64 offset, u64 len, char full_clone_path[PATH_MAX]; int clone_fd = -1; + if (g_verbose >= 2) + fprintf(stderr, + "clone %s, offset %llu, len %llu, clone path %s, clone offset %llu\n", + path, offset, len, clone_path, clone_offset); + ret = path_cat_out(full_path, rctx->full_subvol_path, path); if (ret < 0) { error("clone: source path invalid: %s", path); -- 2.17.0