All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Sidong Yang <realwakka@gmail.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: reflink: Assure length != 0 in btrfs_extent_same()
Date: Thu, 19 Aug 2021 00:24:47 +0200	[thread overview]
Message-ID: <20210818222447.GX5047@twin.jikos.cz> (raw)
In-Reply-To: <20210818160815.1820-1-realwakka@gmail.com>

On Wed, Aug 18, 2021 at 04:08:15PM +0000, Sidong Yang wrote:
> btrfs_extent_same() cannot be called with zero length. Because when
> length is zero, it would be filtered by condition in
> btrfs_remap_file_range(). But if this function is used in other case in
> future, it can make ret as uninitialized.

Do you have a specific future in mind? Adding the assert won't hurt so
ok.

  reply	other threads:[~2021-08-18 22:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 16:08 [PATCH] btrfs: reflink: Assure length != 0 in btrfs_extent_same() Sidong Yang
2021-08-18 22:24 ` David Sterba [this message]
2021-08-18 23:22   ` Sidong Yang
2021-08-19  8:04 ` Nikolay Borisov
2021-08-19 15:32   ` Sidong Yang
2021-08-19 18:12     ` David Sterba
2021-08-20  0:32       ` Sidong Yang

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=20210818222447.GX5047@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=realwakka@gmail.com \
    /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.