From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: add framework to handle device flush error as a volume
Date: Tue, 16 May 2017 17:52:52 +0800 [thread overview]
Message-ID: <7dc65862-fc06-93dc-49d5-2d0c84ea42ad@oracle.com> (raw)
In-Reply-To: <20170509171235.GH5491@twin.jikos.cz>
On 05/10/2017 01:12 AM, David Sterba wrote:
> On Sat, May 06, 2017 at 07:17:54AM +0800, Anand Jain wrote:
>> This adds comments to the flush error handling part of
>> the code, and hopes to maintain the same logic with a
>> framework which can be used to handle the errors at the
>> volume level.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>
> Reviewed-by: David Sterba <dsterba@suse.com>
Thanks.
> So the next step is to preallocate the flush_bio and remove the ENOMEM
> handling.
one or the other way ENOMEM is going to go away. Thinking to fix
blkdev_issue_flush(), which IMO is the right way, its RFC is sent out.
> submit_bio can fail, the error code will be stored to the bio and this
> will be checked in the waiting side.
>
> Then write_dev_flush can be split into 2 functions by the parameter
> 'wait', as the paths are completely independent.
The new KPI blkdev_issue_flush_no_wait() makes it much simpler,
I have sent out the btrfs part of the RFC patch as well. Thanks.
>> +static int check_barrier_error(struct btrfs_fs_devices *fsdevs)
>> +{
>> + int submit_flush_error = 0;
>> + int dev_flush_error = 0;
>> + struct btrfs_device *dev;
>> + int tolerance;
>> +
>> + list_for_each_entry_rcu(dev, &fsdevs->devices, dev_list) {
>> + if (!dev->bdev) {
>> + submit_flush_error++;
>> + dev_flush_error++;
>> + continue;
>> + }
>> + if (dev->last_flush_error == -ENOMEM)
>> + submit_flush_error++;
>> + if (dev->last_flush_error && dev->last_flush_error != -ENOMEM)
>> + dev_flush_error++;
>> + }
>> +
>> + tolerance = fsdevs->fs_info->num_tolerated_disk_barrier_failures;
>> + if (submit_flush_error > tolerance || dev_flush_error > tolerance)
>> + return -EIO;
>
> Actually, after reading submit_bio and the comment above, do we need to
> care about the submission errors? As submit_bio could return -EIO
> immeditaelly, but does not help us anyway. We'll wait and check again
> later. It's the bio completion what counts.
>
> This should simplify the code.
Yeah. we don;t have to worry about the send part of the error, when
all the error that may encounter is all related to the device itself.
There are RFC patches for the device state: offline and failed, now
depending on whether the flush returned EIO or transport error ENXIO
I intend to choice the device state such as of failed or offline
respectively.
Thanks, Anand
prev parent reply other threads:[~2017-05-16 9:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 8:58 [PATCH] btrfs: add framework to handle device flush error as a volume Anand Jain
2017-04-27 2:53 ` Anand Jain
2017-05-05 14:46 ` David Sterba
2017-05-05 23:14 ` Anand Jain
2017-05-05 23:17 ` [PATCH v2] " Anand Jain
2017-05-09 17:12 ` David Sterba
2017-05-16 9:52 ` Anand Jain [this message]
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=7dc65862-fc06-93dc-49d5-2d0c84ea42ad@oracle.com \
--to=anand.jain@oracle.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).