All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] btrfs: fix message not properly printing interval when adding extent map
Date: Wed, 13 Mar 2024 13:20:46 +0000	[thread overview]
Message-ID: <ed32b1183350d7b8a5c9cce7d3e04cada65b828d.1710335452.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1710335452.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

At btrfs_add_extent_mapping(), if we are unable to merge the existing
extent map, we print a warning message that suggests interval ranges in
the form "[X, Y)", where the first element is the inclusive start offset
of a range and the second element is the exclusive end offset. However
we end up printing the length of the ranges instead of the exclusive end
offsets. So fix this by printing the range end offsets.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/extent_map.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 2cfc6e8cf76f..16685cb8a91d 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -634,8 +634,8 @@ int btrfs_add_extent_mapping(struct btrfs_fs_info *fs_info,
 				*em_in = NULL;
 				WARN_ONCE(ret,
 "extent map merge error existing [%llu, %llu) with em [%llu, %llu) start %llu\n",
-					  existing->start, existing->len,
-					  orig_start, orig_len, start);
+					  existing->start, extent_map_end(existing),
+					  orig_start, orig_start + orig_len, start);
 			}
 			free_extent_map(existing);
 		}
-- 
2.43.0


  parent reply	other threads:[~2024-03-13 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 13:20 [PATCH 0/3] btrfs: some minor fixes around extent maps fdmanana
2024-03-13 13:20 ` [PATCH 1/3] btrfs: fix extent map leak in unexpected scenario at unpin_extent_cache() fdmanana
2024-03-13 13:20 ` [PATCH 2/3] btrfs: fix warning messages not printing interval at unpin_extent_range() fdmanana
2024-03-13 13:20 ` fdmanana [this message]
2024-03-13 17:28 ` [PATCH v2 0/4] btrfs: some minor fixes around extent maps fdmanana
2024-03-13 17:28   ` [PATCH v2 1/4] btrfs: fix extent map leak in unexpected scenario at unpin_extent_cache() fdmanana
2024-03-14 12:59     ` Anand Jain
2024-03-13 17:28   ` [PATCH v2 2/4] btrfs: fix warning messages not printing interval at unpin_extent_range() fdmanana
2024-03-13 17:28   ` [PATCH v2 3/4] btrfs: fix message not properly printing interval when adding extent map fdmanana
2024-03-13 17:28   ` [PATCH v2 4/4] btrfs: use btrfs_warn() to log message at btrfs_add_extent_mapping() fdmanana
2024-03-13 19:22   ` [PATCH v2 0/4] btrfs: some minor fixes around extent maps Qu Wenruo
2024-03-14 13:06   ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed32b1183350d7b8a5c9cce7d3e04cada65b828d.1710335452.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.