linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: <dsterba@suse.cz>, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: extent-tree.c: Remove redundant variable from btrfs_cross_ref_exist()
Date: Fri, 7 Sep 2018 12:01:21 +0900	[thread overview]
Message-ID: <ed103469-264b-f556-c34b-81ab8e64e509@jp.fujitsu.com> (raw)
In-Reply-To: <20180906155757.GC24025@twin.jikos.cz>

On 2018/09/07 0:57, David Sterba wrote:
> On Thu, Aug 30, 2018 at 10:59:16AM +0900, Misono Tomohiro wrote:
>> Since commit d7df2c796d7e ("Btrfs attach delayed ref updates to
>> delayed ref heads"), check_delaed_ref() won't return -ENOENT.
>>
>> In btrfs_cross_ref_exist(), two variable 'ret' and 'ret2' is
>> originally used to handle -ENOENT error case.
>>
>> Since the code is not needed anymore, let's just remove 'ret2'.
> 
> Good cleanup and the patch would be ok as-is. I've noticed that
> check_delayed_ref now returns only two values so it might make sense to
> turn it to bool and update the name of check_delayed_ref to make it
> clear what the return value means in the loop.

check_delaed_ref()'s return value is:
 0       ... no cross ref found in delayed ref
 1       ... cross ref found in delayed ref
 -EAGAIN ... cannot acquire lock and try again later

so I don't think we can convert it to bool directly or
do you mean we should handle -EAGAIN in check_delayed_ref()?

> The concern here is that adding another error code in check_delayed_ref
> in the future will not be caught in btrfs_cross_ref_exist. Adding an
> assert filtering only EAGAIN would be sufficient as this might miss the
> extra value in case it'd be an uncommon case.

  reply	other threads:[~2018-09-07  7:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1535593351.git.misono.tomohiro@jp.fujitsu.com>
2018-08-30  1:59 ` [PATCH] btrfs: extent-tree.c: Remove redundant variable from btrfs_cross_ref_exist() Misono Tomohiro
2018-09-06 15:57   ` David Sterba
2018-09-07  3:01     ` Misono Tomohiro [this message]
2018-09-07 11:17       ` David Sterba

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=ed103469-264b-f556-c34b-81ab8e64e509@jp.fujitsu.com \
    --to=misono.tomohiro@jp.fujitsu.com \
    --cc=dsterba@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).