From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix off-by-one end offset check in report_setget_bounds()
Date: Thu, 1 Oct 2026 07:14:30 +0930 [thread overview]
Message-ID: <09d5b3e0-c0e4-48a3-86d4-e52ece374bad@suse.com> (raw)
In-Reply-To: <d424b06da106d3e4bc54416eca428701647e8f08.1790781569.git.fdmanana@suse.com>
在 2026/10/1 00:49, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> The addressable range with an extent buffer goes from byte 0 to byte
> eb->len - 1, so if a byte address matches eb->len, it's already beyond
> the addressable range and we should log that it's bad start address
> and not end address.
>
> Fixes: 234fdd2815ce ("btrfs: remove redundant check in up check_setget_bounds")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/accessors.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/accessors.c b/fs/btrfs/accessors.c
> index 1248aa2535d3..d63ac6eb92de 100644
> --- a/fs/btrfs/accessors.c
> +++ b/fs/btrfs/accessors.c
> @@ -16,7 +16,7 @@ static void __cold report_setget_bounds(const struct extent_buffer *eb,
>
> btrfs_warn(eb->fs_info,
> "bad eb member %s: ptr 0x%lx start %llu member offset %lu size %d",
> - (member_offset > eb->len ? "start" : "end"),
> + (member_offset >= eb->len ? "start" : "end"),
> (unsigned long)ptr, eb->start, member_offset, size);
> }
>
prev parent reply other threads:[~2026-09-30 21:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 15:19 [PATCH] btrfs: fix off-by-one end offset check in report_setget_bounds() fdmanana
2026-09-30 17:33 ` Daniel Vacek
2026-09-30 21:44 ` Qu Wenruo [this message]
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=09d5b3e0-c0e4-48a3-86d4-e52ece374bad@suse.com \
--to=wqu@suse.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox