From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD731C34026 for ; Tue, 18 Feb 2020 20:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2E1D24125 for ; Tue, 18 Feb 2020 20:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582056352; bh=ObdtB8WiQ7UgrHn8retaPbeSEF6sSEYZalXcNXXdMS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QYFES1HMtGllAP9kWOCNCVQ1OIN3y7HiiznHmGoayw4dC/QpjOWFTdbbsP3fnuDh2 kkn2Fzbf//CLPNLIeQdoZmNz8dg4kLJIK1V7gkpYehj4+Srpp1hMJQPZBnquOL7iVC V7Y3Z3ido6HtndvlcvUntrUkdRjHafWIr+FcllVM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbgBRUFu (ORCPT ); Tue, 18 Feb 2020 15:05:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:40758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbgBRUBO (ORCPT ); Tue, 18 Feb 2020 15:01:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53B6524670; Tue, 18 Feb 2020 20:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582056073; bh=ObdtB8WiQ7UgrHn8retaPbeSEF6sSEYZalXcNXXdMS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0f0dA92btEvaGhuvh3IOLYqnIS+DHVW/s4AQh2hojMYnha/j2WsU3ppiehBd4rMds YbYVa2KhNZIpb0EnbjHauzTQXQm/j7AS1SvBl8aKiNDMDMcSHGZX3mq65piZfC5++U mek5k8FhLiZju2Xpc7gqlYIndFYprlALceLfzPIE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anand Jain , Johannes Thumshirn , David Sterba Subject: [PATCH 5.5 24/80] btrfs: log message when rw remount is attempted with unclean tree-log Date: Tue, 18 Feb 2020 20:54:45 +0100 Message-Id: <20200218190434.690498465@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190432.043414522@linuxfoundation.org> References: <20200218190432.043414522@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Sterba commit 10a3a3edc5b89a8cd095bc63495fb1e0f42047d9 upstream. A remount to a read-write filesystem is not safe when there's tree-log to be replayed. Files that could be opened until now might be affected by the changes in the tree-log. A regular mount is needed to replay the log so the filesystem presents the consistent view with the pending changes included. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Anand Jain Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/super.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1803,6 +1803,8 @@ static int btrfs_remount(struct super_bl } if (btrfs_super_log_root(fs_info->super_copy) != 0) { + btrfs_warn(fs_info, + "mount required to replay tree-log, cannot remount read-write"); ret = -EINVAL; goto restore; }