All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Su Yue <suy.fnst@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: returns -ENOMEM if path allocation failed in btrfs_cross_ref_exist()
Date: Wed, 30 May 2018 17:33:38 +0200	[thread overview]
Message-ID: <20180530153338.GF3539@twin.jikos.cz> (raw)
In-Reply-To: <20180530064910.8724-1-suy.fnst@cn.fujitsu.com>

On Wed, May 30, 2018 at 02:49:10PM +0800, Su Yue wrote:
> btrfs_alloc_path() may fail due to no enough memory,
> so let the function return -ENOMEM instead of -ENOENT is better.
> 
> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>

Reviewed-by: David Sterba <dsterba@suse.com>

Thanks. I've audited all return codes after failed path allocation, this
was the only one not matching.

The return code of btrfs_cross_ref_exist should be also distinguished at
the call sites, as both places expect only the ENOENT but should not
react to ENOMEM as if it were ENOENT.

  parent reply	other threads:[~2018-05-30 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30  2:07 [PATCH 1/2] btrfs: returns -ENOMEM if path allocation failed in btrfs_cross_ref_exist() Su Yue
2018-05-30  2:55 ` Su Yue
2018-05-30  6:24 ` Nikolay Borisov
2018-05-30  6:49 ` [PATCH v2] " Su Yue
2018-05-30  6:44   ` Nikolay Borisov
2018-05-30 15:33   ` David Sterba [this message]
2018-05-31  2:08     ` Su Yue

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=20180530153338.GF3539@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=suy.fnst@cn.fujitsu.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.