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 2/2] btrfs: reset SB MOVED_ON flag for dynamically reappearing missing device
Date: Mon, 13 Nov 2017 13:53:41 +0800	[thread overview]
Message-ID: <20171113055341.25764-2-anand.jain@oracle.com> (raw)
In-Reply-To: <20171113055341.25764-1-anand.jain@oracle.com>

When the missing device reappears and joins the RAID group, and if there
are no more missing device at the volume level, then reset the
BTRFS_SUPER_FLAG_VOL_MOVED_ON flag.

This patch is on top of the patch [1] in the ML.
[1] btrfs: handle dynamically reappearing missing device

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/volumes.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ba32e2d73fbe..8bac1cf17048 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -798,6 +798,10 @@ static noinline int device_list_add(const char *path,
 				btrfs_warn(fs_info,
 					"BTRFS: device %s devid %llu uuid %pU joined\n",
 					path, devid, device->uuid);
+				if (!fs_devices->missing_devices)
+					btrfs_set_super_flags(fs_info->super_copy,
+						fs_info->super_copy->flags &
+						~BTRFS_SUPER_FLAG_VOL_MOVED_ON);
 			}
 
 			if (device->writeable &&
-- 
2.13.1


      reply	other threads:[~2017-11-13  5:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13  5:53 [PATCH 1/2] btrfs: handle volume split brain scenario Anand Jain
2017-11-13  5:53 ` 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=20171113055341.25764-2-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).