From: Anand Jain <anand.jain@oracle.com>
To: Liu Bo <bo.li.liu@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/4] Btrfs: introduce device flags
Date: Tue, 7 Nov 2017 17:30:16 +0800 [thread overview]
Message-ID: <e03b68bf-c120-715c-191e-2c07819a949f@oracle.com> (raw)
In-Reply-To: <20171102005405.20420-2-bo.li.liu@oracle.com>
On 11/02/2017 08:54 AM, Liu Bo wrote:
> Here we have defined two flags,
> - Fautly
> - In_sync
>
> Currently only In_sync is in use, it only matters when device serves
> as part of a raid profile. The flag In_sync is decided when mounting
> a btrfs and opening a device, by default every device is set with
> In_sync, but would not be set if its generation was out of date.
>
> If the device doesn't get resync and to avoid overriding its
> generation during writing superblock, if the !In_sync device is still
> writeable, its last valid generation will be recorded in
> superblock.dev_item.generation instead of superblock.generation, such
> that the last valid generation can be retained through several reboot,
> btrfs is able to detect the out-of-sync device.
Based on the bug you are trying to address in patch 2/4.
- I still don't get the point the need for explicit flag
In_Sync for the whole disk and not just depend on stripe
for which anyway crc will fail ?
- Here whole disk isn't the problem. Only the stripe which
were missed on the missing disk is the problem.
> @@ -6592,6 +6625,14 @@ static int read_one_dev(struct btrfs_fs_info *fs_info,
> return -EIO;
> }
>
> + if (!test_bit(In_sync, &device->flags) &&
> + !btrfs_test_opt(fs_info, DEGRADED)) {
> + btrfs_warn(fs_info,
> + "devid %llu uuid %pU is Not in_sync, but we're not under degraded mode",
> + devid, dev_uuid);
> + return -EIO;
> + }
> +
degrade option is for the missing device and if user still want to
continue, here its about device with not_In_Sync flag, degrade option
check is not required.
Similarly the test case should be updated as well.
Thanks, Anand
next prev parent reply other threads:[~2017-11-07 9:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 0:54 [PATCH 0/4] Fix raid6 reconstruction bug Liu Bo
2017-11-02 0:54 ` [PATCH 1/4] Btrfs: introduce device flags Liu Bo
2017-11-06 16:40 ` David Sterba
2017-11-08 19:46 ` Liu Bo
2017-11-13 17:13 ` David Sterba
2017-11-07 9:30 ` Anand Jain [this message]
2017-11-02 0:54 ` [PATCH 2/4] Btrfs: fix data corruption in raid6 Liu Bo
2017-11-07 8:32 ` Anand Jain
2017-11-08 19:53 ` Liu Bo
2017-11-09 9:29 ` Anand Jain
2017-11-09 9:59 ` Qu Wenruo
2017-11-10 0:12 ` Liu Bo
2017-11-10 0:54 ` Qu Wenruo
2017-11-10 10:15 ` Qu Wenruo
2017-11-02 0:54 ` [PATCH 3/4] Btrfs: make raid1 and raid10 be aware of device flag In_sync Liu Bo
2017-11-02 0:54 ` [PATCH 4/4] Btrfs: change how we set In_sync Liu Bo
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=e03b68bf-c120-715c-191e-2c07819a949f@oracle.com \
--to=anand.jain@oracle.com \
--cc=bo.li.liu@oracle.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;
as well as URLs for NNTP newsgroup(s).