All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "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>,
	"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: Wed, 30 Jun 2021 11:59:23 +0200	[thread overview]
Message-ID: <20210630095923.GH2610@twin.jikos.cz> (raw)
In-Reply-To: <PH0PR04MB741666CF29DB96CF0DB0C26B9B029@PH0PR04MB7416.namprd04.prod.outlook.com>

On Tue, Jun 29, 2021 at 09:04:40AM +0000, Johannes Thumshirn wrote:
> 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.

If you have real workloads hitting the warning then it really should be
proper error handling, not even an assert.

  reply	other threads:[~2021-06-30 10:01 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
2021-06-30  9:59   ` David Sterba [this message]
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=20210630095923.GH2610@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=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.