public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@kernel.org>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/4] btrfs: stop checking for NULL return from btrfs_get_extent()
Date: Fri, 4 Feb 2022 11:17:58 +0000	[thread overview]
Message-ID: <Yf0LZsuAKfhkXy0f@debian9.Home> (raw)
In-Reply-To: <PH0PR04MB74166389066CAEC3C1F84B2F9B299@PH0PR04MB7416.namprd04.prod.outlook.com>

On Fri, Feb 04, 2022 at 08:19:08AM +0000, Johannes Thumshirn wrote:
> On 03/02/2022 16:37, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> > 
> > At extent_io.c, in the read page and write page code paths, we are testing
> > if the return value from btrfs_get_extent() can be NULL. However that is
> > not possible, as btrfs_get_extent() always returns either an error pointer
> > or a (non-NULL) pointer to an extent map structure.
> > 
> > Eveywhere else outside extent_io.c we never check for NULL, we always
> > treat any returned value as a non-NULL pointer if it does not encode an
> > error.
> > 
> > So check only for the IS_ERR() case at extent_io.c.
> > 
> 
> Isn't the same true for btrfs_get_extent_fiemap()? In get_extent_skip_holes() 
> we're also checking for IS_ERR_OR_NULL() but AFAICS btrfs_get_extent_fiemap()
> will never return NULL only a valid em or an error pointer.

Yep.
I was focused on the read and write page paths, due to the next change, so I
missed that one.

I can send another patch to fix that one, or if you want to do it yourself,
please go ahead.

Thanks.

> 
> Anyways for this patch:
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

  reply	other threads:[~2022-02-04 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 15:36 [PATCH 0/4] btrfs: some misc cleanups and a fix around page reading fdmanana
2022-02-03 15:36 ` [PATCH 1/4] btrfs: stop checking for NULL return from btrfs_get_extent() fdmanana
2022-02-04  8:19   ` Johannes Thumshirn
2022-02-04 11:17     ` Filipe Manana [this message]
2022-02-03 15:36 ` [PATCH 2/4] btrfs: fix lost error return value when reading a data page fdmanana
2022-02-03 15:36 ` [PATCH 3/4] btrfs: remove no longer used counter when reading " fdmanana
2022-02-03 15:36 ` [PATCH 4/4] btrfs: assert we have a write lock when removing and replacing extent maps fdmanana
2022-02-04  8:25 ` [PATCH 0/4] btrfs: some misc cleanups and a fix around page reading Johannes Thumshirn
2022-02-04 16:35 ` David Sterba
2022-02-08 15:45   ` 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=Yf0LZsuAKfhkXy0f@debian9.Home \
    --to=fdmanana@kernel.org \
    --cc=Johannes.Thumshirn@wdc.com \
    --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