All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/3] btrfs: fix warning messages not printing interval at unpin_extent_range()
Date: Wed, 13 Mar 2024 13:20:45 +0000	[thread overview]
Message-ID: <7039902fc65bb3ec188a461436d19afbc71da1c1.1710335452.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1710335452.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

At unpin_extent_range() we print warning messages that are supposed to
print an interval in the form "[X, Y)", with the first element being an
inclusive start offset and the second element being the exclusive end
offset of a range. However we end up printing the range's length instead
of the range's exclusive end offset, so fix that to avoid having confusing
and non-sense messages in case we hit one of these unexpected scenarios.

Fixes: 00deaf04df35 ("btrfs: log messages at unpin_extent_range() during unexpected cases")
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 e03953dbcd5e..2cfc6e8cf76f 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -309,7 +309,7 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen)
 		btrfs_warn(fs_info,
 "no extent map found for inode %llu (root %lld) when unpinning extent range [%llu, %llu), generation %llu",
 			   btrfs_ino(inode), btrfs_root_id(inode->root),
-			   start, len, gen);
+			   start, start + len, gen);
 		ret = -ENOENT;
 		goto out;
 	}
@@ -318,7 +318,7 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen)
 		btrfs_warn(fs_info,
 "found extent map for inode %llu (root %lld) with unexpected start offset %llu when unpinning extent range [%llu, %llu), generation %llu",
 			   btrfs_ino(inode), btrfs_root_id(inode->root),
-			   em->start, start, len, gen);
+			   em->start, start, start + len, gen);
 		ret = -EUCLEAN;
 		goto out;
 	}
-- 
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 ` fdmanana [this message]
2024-03-13 13:20 ` [PATCH 3/3] btrfs: fix message not properly printing interval when adding extent map fdmanana
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=7039902fc65bb3ec188a461436d19afbc71da1c1.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.