All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: "lijian_8010a29@163.com" <lijian_8010a29@163.com>,
	"clm@fb.com" <clm@fb.com>,
	"josef@toxicpanda.com" <josef@toxicpanda.com>,
	"dsterba@suse.com" <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	lijian <lijian@yulong.com>
Subject: Re: [PATCH] fs: btrfs: extent_map: removed unneeded variable
Date: Tue, 29 Jun 2021 09:04:40 +0000	[thread overview]
Message-ID: <PH0PR04MB741666CF29DB96CF0DB0C26B9B029@PH0PR04MB7416.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20210629085025.98437-1-lijian_8010a29@163.com

On 29/06/2021 10:51, lijian_8010a29@163.com wrote:
> From: lijian <lijian@yulong.com>
> 
> removed unneeded variable 'ret'.

Wouldn't it make more sense to return an error (-ENOENT??) in case
the em lookup fails and handle the error in btrfs_finish_ordered_io()
as this is the only caller of unpin_extent_cache()?

I've actually tripped over this a couple of times already when 
investigating extent map and ordered extent splitting problems
on zoned filesystems:

	em = lookup_extent_mapping(tree, start, len);
	WARN_ON(!em || em->start != start);

Maybe even turn this WARN_ON() into an ASSERT() when introducing proper
error handling, as we shouldn't really get there unless we have a logical
error.

  reply	other threads:[~2021-06-29  9:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  8:50 [PATCH] fs: btrfs: extent_map: removed unneeded variable lijian_8010a29
2021-06-29  9:04 ` Johannes Thumshirn [this message]
2021-06-30  9:59   ` David Sterba
2021-06-30 11:17     ` Johannes Thumshirn

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=PH0PR04MB741666CF29DB96CF0DB0C26B9B029@PH0PR04MB7416.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=lijian@yulong.com \
    --cc=lijian_8010a29@163.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@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 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.