From patchwork Mon Oct 10 09:21:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9369201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D96CF607FD for ; Mon, 10 Oct 2016 09:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAD0329475 for ; Mon, 10 Oct 2016 09:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF5512947B; Mon, 10 Oct 2016 09:21:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F26129475 for ; Mon, 10 Oct 2016 09:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751378AbcJJJVK (ORCPT ); Mon, 10 Oct 2016 05:21:10 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:51915 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751015AbcJJJVJ (ORCPT ); Mon, 10 Oct 2016 05:21:09 -0400 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="888734" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 10 Oct 2016 17:21:03 +0800 Received: from adam-work.localdomain (unknown [10.167.226.34]) by cn.fujitsu.com (Postfix) with ESMTP id 38F5F41B4BC4; Mon, 10 Oct 2016 17:21:02 +0800 (CST) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH] btrfs-progs: btrfstune: Register new UUIDs after uuid change Date: Mon, 10 Oct 2016 17:21:01 +0800 Message-Id: <20161010092101.469-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 38F5F41B4BC4.AD925 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For multi-device btrfs, after UUID change we should info kernel, or new fs can't be mounted due to false alert on missing devices. Signed-off-by: Qu Wenruo --- btrfstune.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/btrfstune.c b/btrfstune.c index 15dde90..23d06ce 100644 --- a/btrfstune.c +++ b/btrfstune.c @@ -369,6 +369,15 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const char *new_fsid_str) fs_info->new_fsid = NULL; fs_info->new_chunk_tree_uuid = NULL; printf("Fsid change finished\n"); + + /* + * Register new devices, or multi-volume btrfs can't be mounted until + * device scan happens. + * Ignore any error, as such register is optional. + */ + printf("Register new UUIDs(error can be ignored)\n"); + btrfs_register_all_devices(); + out: return ret; }