From patchwork Tue Feb 18 19:54:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 231088 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 B6E51C34026 for ; Tue, 18 Feb 2020 20:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 801472067D for ; Tue, 18 Feb 2020 20:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582056497; bh=KpYOPciSmTWjaph1IG5iXug5PcvcPFkmcNBP0aZpfJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RJPvV3f4ZNSxTR2bJX6WMkiVjiZ6aKSOcO5TfyX5ewHV2ECH4dM/jRurQTgTtznVq DirFTePCPE9aqavMz0iM2FwyZkU/aI58xJ4o1Rw0pMBXURJevyJc5mCetpcNAQWPYJ CTOVjwA0eWYAznrfkjVE06Et1rBJ1i6A3dXhbvXQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbgBRT6K (ORCPT ); Tue, 18 Feb 2020 14:58:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:35672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728128AbgBRT6J (ORCPT ); Tue, 18 Feb 2020 14:58:09 -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 1E05520659; Tue, 18 Feb 2020 19:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582055889; bh=KpYOPciSmTWjaph1IG5iXug5PcvcPFkmcNBP0aZpfJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5cSV8CucBJTs/ZHKVWKF2218QqpXEbK/iGDuy4FjPX5SU+ulO8iMU230gFviN8zQ 5aTWDELlW0hX6nzc2eJBueHvOxxgLlB9S9CrgePpIW9H+NMN10DH8IsWPS4L3EpD2C 4QKlisyOnh03QQe8oahTlBdJH3iP74i3tB4RDPEM= 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.4 22/66] btrfs: log message when rw remount is attempted with unclean tree-log Date: Tue, 18 Feb 2020 20:54:49 +0100 Message-Id: <20200218190430.142378570@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190428.035153861@linuxfoundation.org> References: <20200218190428.035153861@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -1804,6 +1804,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; }