From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 03/11] btrfs-progs: track missing device counter
Date: Fri, 7 Jul 2023 23:52:33 +0800 [thread overview]
Message-ID: <cd1a6eb0c0c04105d5e3ae76a4959ef89c704cd1.1688724045.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1688724045.git.anand.jain@oracle.com>
Maintain the btrfs_fs_devices::missing counter to track the number of
missing devices.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
kernel-shared/volumes.c | 2 ++
kernel-shared/volumes.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c
index d20cb3177a34..671396dba689 100644
--- a/kernel-shared/volumes.c
+++ b/kernel-shared/volumes.c
@@ -2156,6 +2156,7 @@ static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key,
(unsigned long long)devid);
list_add(&map->stripes[i].dev->dev_list,
&fs_info->fs_devices->devices);
+ fs_info->fs_devices->missing++;
}
}
@@ -2259,6 +2260,7 @@ static int read_one_dev(struct btrfs_fs_info *fs_info,
device->fd = -1;
list_add(&device->dev_list,
&fs_info->fs_devices->devices);
+ fs_info->fs_devices->missing++;
}
fill_device_from_item(leaf, dev_item, device);
diff --git a/kernel-shared/volumes.h b/kernel-shared/volumes.h
index ab5ac40269bb..d2915681e6de 100644
--- a/kernel-shared/volumes.h
+++ b/kernel-shared/volumes.h
@@ -90,6 +90,7 @@ struct btrfs_fs_devices {
u64 total_rw_bytes;
+ int missing;
int latest_bdev;
int lowest_bdev;
struct list_head devices;
--
2.39.3
next prev parent reply other threads:[~2023-07-07 15:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 15:52 [PATCH 00/11] btrfs-progs: fix bugs and CHANGING_FSID_V2 flag Anand Jain
2023-07-07 15:52 ` [PATCH 01/11] btrfs-progs: fix duplicate missing device Anand Jain
2023-07-07 15:52 ` [PATCH 02/11] btrfs-progs: call warn() for " Anand Jain
2023-07-13 18:48 ` David Sterba
2023-07-17 18:22 ` Anand Jain
2023-07-19 14:34 ` Anand Jain
2023-07-07 15:52 ` Anand Jain [this message]
2023-07-07 15:52 ` [PATCH 04/11] btrfs-progs: NULL initialize device name for missing Anand Jain
2023-07-07 15:52 ` [PATCH 05/11] btrfs-progs: tune: check for missing device Anand Jain
2023-07-13 18:49 ` David Sterba
2023-07-17 19:02 ` Anand Jain
2023-07-07 15:52 ` [PATCH 06/11] btrfs-progs: track changing_fsid flag in fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 07/11] btrfs-progs: track num_devices per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 08/11] btrfs-progs: track total_devs in fs devices Anand Jain
2023-07-13 18:58 ` David Sterba
2023-07-17 19:28 ` Anand Jain
2023-07-07 15:52 ` [PATCH 09/11] btrfs-progs: track active metadata_uuid per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 10/11] btrfs-progs: add helper to reunite devices with same metadata_uuid Anand Jain
2023-07-07 15:52 ` [PATCH 11/11] btrfs-progs: tune: fix incomplete fsid_change Anand Jain
2023-07-13 18:57 ` David Sterba
2023-07-17 19:25 ` Anand Jain
2023-07-20 14:33 ` Anand Jain
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=cd1a6eb0c0c04105d5e3ae76a4959ef89c704cd1.1688724045.git.anand.jain@oracle.com \
--to=anand.jain@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).