From patchwork Thu Feb 27 13:35:26 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: 230546 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 E0432C3567B for ; Thu, 27 Feb 2020 13:40:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACAEA2469F for ; Thu, 27 Feb 2020 13:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582810822; bh=HJS9UFbR8ju5fqaxIE7LfFVdi9AUqyogj5i0guOvO50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tXmTPDXacPhcel/SPWZP9bT+3IWFKZ4pkXu4WKuko8FsljTrjY75gBAV3TmdU2bW7 8j9VqPUN6QFW8A3sywXZ6pZ5dug7iTMWBXZTi0byh3uTZ0zn+7ZwQ4OpKzILwVBmkE 7loDWs3fwhDYYu9qKxatQBRnUfLD1GMFfZHl0b5o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbgB0NkT (ORCPT ); Thu, 27 Feb 2020 08:40:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:34574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729030AbgB0NkT (ORCPT ); Thu, 27 Feb 2020 08:40:19 -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 A1FBF2469F; Thu, 27 Feb 2020 13:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582810819; bh=HJS9UFbR8ju5fqaxIE7LfFVdi9AUqyogj5i0guOvO50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uIWphGIvo/4gM9ZYsbEKrX7SXN4uXaUun0SNjpNUUdUY/XnruqI0mMq312Yvvm8pv G8DkrMDcsVNOZzDM8HD6pkTUrga7fOBvXupwGRkIQTP+vmAGM4wx/1QcLuSoufMNkS 4UCTE/5ZMC+MzY1ouv4BpHBdkPaGHYHMNm0UR+Oc= 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 4.4 010/113] btrfs: log message when rw remount is attempted with unclean tree-log Date: Thu, 27 Feb 2020 14:35:26 +0100 Message-Id: <20200227132213.378746014@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132211.791484803@linuxfoundation.org> References: <20200227132211.791484803@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 @@ -1702,6 +1702,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; }