linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 05/11] btrfs-progs: tune: check for missing device
Date: Fri,  7 Jul 2023 23:52:35 +0800	[thread overview]
Message-ID: <3b6a812b25429342811a22687245c9732a715a8f.1688724045.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1688724045.git.anand.jain@oracle.com>

If btrfstune is executed on a filesystem that contains a missing device,
the command will now fail.

It is ok fail when any of the options supported by btrfstune are used.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tune/main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tune/main.c b/tune/main.c
index 570e3908ef8a..dc72944a2b67 100644
--- a/tune/main.c
+++ b/tune/main.c
@@ -330,6 +330,13 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
 		goto free_out;
 	}
 
+	if (root->fs_info->fs_devices->missing) {
+		error("missing %d device(s), failing the command",
+		       root->fs_info->fs_devices->missing);
+		ret = 1;
+		goto free_out;
+	}
+
  	if (to_bg_tree) {
 		if (to_extent_tree) {
 			error("option --convert-to-block-group-tree conflicts with --convert-from-block-group-tree");
-- 
2.39.3


  parent reply	other threads:[~2023-07-07 15:54 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 ` [PATCH 03/11] btrfs-progs: track missing device counter Anand Jain
2023-07-07 15:52 ` [PATCH 04/11] btrfs-progs: NULL initialize device name for missing Anand Jain
2023-07-07 15:52 ` Anand Jain [this message]
2023-07-13 18:49   ` [PATCH 05/11] btrfs-progs: tune: check for missing device 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=3b6a812b25429342811a22687245c9732a715a8f.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).