From patchwork Thu Feb 27 13:34:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 230139 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 6C32AC35677 for ; Thu, 27 Feb 2020 14:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A68524656 for ; Thu, 27 Feb 2020 14:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582814709; bh=CENOdGeV86X9lr5u9jBD4J2oylUsg0B0ywMKJ57Wngw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xcnhmBx/ncZy+J55CKPjEagrCH7iEMBdvLONkrRYT46w5Ed77MZMcy2aRchsbSoS5 QqZN9UKYdFf+X1GqxOo8POYhmNkorIIRJYiVkoJygtyR9NhjxwHojgtSNS/VTg92vT QXQM+TKSSul/v7YsdMRakZ5WrO8tt4qFVTEMvqb4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730620AbgB0NrC (ORCPT ); Thu, 27 Feb 2020 08:47:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:43364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730616AbgB0NrB (ORCPT ); Thu, 27 Feb 2020 08:47:01 -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 C8BBE24688; Thu, 27 Feb 2020 13:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811220; bh=CENOdGeV86X9lr5u9jBD4J2oylUsg0B0ywMKJ57Wngw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZB9rJnVgX7TJK+0psNGaImFBC9dQio0pHvrVmGDZgtJrTzHlZ41QBlybA6P5imsDs HaQWhJb4aNI5WvbBWaXaEnq0LmDw7K+MvGWk63ZCF26MbJxdh+eTrX6XmXtwbb/XoL Qlro1NxS3KzCDF2fZ+Lts+HVsst9fetPLiU7dtgI= 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.9 011/165] btrfs: log message when rw remount is attempted with unclean tree-log Date: Thu, 27 Feb 2020 14:34:45 +0100 Message-Id: <20200227132232.721882097@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132230.840899170@linuxfoundation.org> References: <20200227132230.840899170@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 @@ -1809,6 +1809,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; }