Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: collapse report_eb_range() into its single caller
Date: Fri, 24 Apr 2026 07:13:01 +0930	[thread overview]
Message-ID: <fb37b237-b6ef-4b12-9255-66ee23fead2e@suse.com> (raw)
In-Reply-To: <b2dc0f485fc063e2b666e150002f59a278b97023.1776944252.git.fdmanana@suse.com>



在 2026/4/23 21:08, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
> 
> There's no point in having this static function since it's too short and
> it has a single caller (check_eb_range()), so move its code into the
> caller and remove it.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/extent_io.c | 20 +++++++-------------
>   1 file changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 6a6d98eec787..2b0aec031a9a 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3976,17 +3976,6 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int mirror_num,
>   	return 0;
>   }
>   
> -static bool report_eb_range(const struct extent_buffer *eb, unsigned long start,
> -			    unsigned long len)
> -{
> -	btrfs_warn(eb->fs_info,
> -		"access to eb bytenr %llu len %u out of range start %lu len %lu",
> -		eb->start, eb->len, start, len);
> -	DEBUG_WARN();
> -
> -	return true;
> -}
> -
>   /*
>    * Check if the [start, start + len) range is valid before reading/writing
>    * the eb.
> @@ -4000,8 +3989,13 @@ static inline int check_eb_range(const struct extent_buffer *eb,
>   	unsigned long offset;
>   
>   	/* start, start + len should not go beyond eb->len nor overflow */
> -	if (unlikely(check_add_overflow(start, len, &offset) || offset > eb->len))
> -		return report_eb_range(eb, start, len);
> +	if (unlikely(check_add_overflow(start, len, &offset) || offset > eb->len)) {
> +		btrfs_warn(eb->fs_info,
> +		   "access to eb bytenr %llu len %u out of range start %lu len %lu",
> +			   eb->start, eb->len, start, len);
> +		DEBUG_WARN();
> +		return true;
> +	}
>   
>   	return false;
>   }


  parent reply	other threads:[~2026-04-23 21:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 11:38 [PATCH] btrfs: collapse report_eb_range() into its single caller fdmanana
2026-04-23 14:54 ` Johannes Thumshirn
2026-04-23 21:43 ` Qu Wenruo [this message]
2026-04-24  2:38 ` David Sterba
2026-04-24  3:11   ` David Sterba
2026-04-24 15:20     ` Filipe Manana

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=fb37b237-b6ef-4b12-9255-66ee23fead2e@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