Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp664275ybt; Wed, 8 Jul 2020 08:45:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+RHpVal1Eq2lVkfGR+hlvE3QoBEVNtiLv91GNd+1XHTZ0pEVKYVzkgw53tFIFl0d4lCF7 X-Received: by 2002:a05:6402:17ee:: with SMTP id t14mr65683378edy.359.1594223147760; Wed, 08 Jul 2020 08:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594223147; cv=none; d=google.com; s=arc-20160816; b=hjgJ+xJmwKgRYwPcBlj2pnzhMTgq/x9bNxNrQCYXPp1u8fi4495GUfkq3VfjI5buLM KGeOlsnOl5Do4gcFf4SkcDaWrsFh7U++6rDjusZgu9hw9dctH25fypaT6puo0M6rZFcw D0yE+PoFFWAhYdaBow/vlEZw6E9/g/bdhzzhOTP8C9KHKQYJhbg6oZ6DPZ3T/A1Ccc9C ADQA8VhMOaGQ/NJ49q0Mb+D5QNf1SwVAUHGv8rvyYAna+7nquaiAA2navY1NkG+Wzsfj Ap80uU7Rc6VdCNXFnhC4YSG7nrpZaBZdK+PYb+Q/58BeIamP1i1tiO4PpUrGD3JJRx02 QdZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Txn8U0/mhK1Z0leduZRPbGJ3nLwshlT3O+r63gHOVpE=; b=rZ5dUiHaKuBqYE2q45yQBIdK7YhUc+rt6fx1118jtDXhLDX5tDKY6cyBgzF/ahwo8K oh30+nqQuCnDG9c6gEQBDLfgizKhQJxrCpebikuWh5Vnl1/1eTBhrMdT3xSnRaIPtyaN wJ9Jb5t2unXeFhrSe9rjPPNb5JrMEIgGs5K45u3Ox/QrC00nRvf+sfGqaLdKQV/wXQU5 GiNGtGax7Z2Q+njtUUxGSQsB+LgWxsmwXuPUdS3WLP74dONsXPWygngwl8AHsjPlzklp xAyMDeeLJ9e62yyYyzn1+jgjzpUc/dPzaVK+rvlFmD4LkSm4AbLMhuZzBZrty23kQ0co 4xtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZjWSZ4vQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si198059edv.382.2020.07.08.08.45.24; Wed, 08 Jul 2020 08:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZjWSZ4vQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730866AbgGHPoL (ORCPT + 99 others); Wed, 8 Jul 2020 11:44:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730395AbgGHPl2 (ORCPT ); Wed, 8 Jul 2020 11:41:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E608020786; Wed, 8 Jul 2020 15:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594222887; bh=fBu0ClO0KQXec2oBjKGmKPAybI4/hbfUxR6w24vd01g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZjWSZ4vQazQU3XfWD6nsDbiET9RVvRWR5hJ0Q6Xt3ibXsAICKWoIoxym8WKroCF+2 ypv9lYHC6GeuqckuZ8uiJzuxwCZl/7yuE2KkiDl7EL05lHPHUq+Ct36KCHdg/D237w 86tqEmQFePW7KSl9AFVq363+iDMtC2ZHO98H/MiE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hyunchul Lee , Sungjong Seo , Namjae Jeon , Sasha Levin , linux-fsdevel@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 08/30] exfat: call sync_filesystem for read-only remount Date: Wed, 8 Jul 2020 11:40:54 -0400 Message-Id: <20200708154116.3199728-8-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708154116.3199728-1-sashal@kernel.org> References: <20200708154116.3199728-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hyunchul Lee [ Upstream commit a0271a15cf2cf907ea5b0f2ba611123f1b7935ec ] We need to commit dirty metadata and pages to disk before remounting exfat as read-only. This fixes a failure in xfstests generic/452 generic/452 does the following: cp something / mount -o remount,ro the /something is corrupted. because while exfat is remounted as read-only, exfat doesn't have a chance to commit metadata and vfs invalidates page caches in a block device. Signed-off-by: Hyunchul Lee Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin --- fs/exfat/super.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index c1b1ed306a485..e879801533980 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -637,10 +637,20 @@ static void exfat_free(struct fs_context *fc) } } +static int exfat_reconfigure(struct fs_context *fc) +{ + fc->sb_flags |= SB_NODIRATIME; + + /* volume flag will be updated in exfat_sync_fs */ + sync_filesystem(fc->root->d_sb); + return 0; +} + static const struct fs_context_operations exfat_context_ops = { .parse_param = exfat_parse_param, .get_tree = exfat_get_tree, .free = exfat_free, + .reconfigure = exfat_reconfigure, }; static int exfat_init_fs_context(struct fs_context *fc) -- 2.25.1