Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: dsterba@suse.cz, Nikolay Borisov <nborisov@suse.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: reflink: Assure length != 0 in btrfs_extent_same()
Date: Fri, 20 Aug 2021 00:32:57 +0000	[thread overview]
Message-ID: <20210820003257.GA17604@realwakka> (raw)
In-Reply-To: <20210819181249.GJ5047@twin.jikos.cz>

On Thu, Aug 19, 2021 at 08:12:49PM +0200, David Sterba wrote:
> On Thu, Aug 19, 2021 at 03:32:16PM +0000, Sidong Yang wrote:
> > On Thu, Aug 19, 2021 at 11:04:58AM +0300, Nikolay Borisov wrote:
> > > 
> > > 
> > > On 18.08.21 г. 19:08, 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.
> > > > 
> > > > Signed-off-by: Sidong Yang <realwakka@gmail.com>
> > > 
> > > This is not sufficient, with the assert compiled out the error would
> > > still be in place. It seem that it is sufficient to initialize ret to
> > > some non-arbitrary value i.e -EINVAL ?
> > 
> > I agree. It's better way to assign intial value than adding assert. If
> > there is code that initialize ret, It seems that assert is no need for
> > this.
> 
> Patch with assert removed, please send the one initializing the return
> value, thanks.

Sure, I'll write it in v2.

Thanks,
Sidong

      reply	other threads:[~2021-08-20  0:33 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
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 [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=20210820003257.GA17604@realwakka \
    --to=realwakka@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox