Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp349942ybg; Fri, 12 Jun 2020 03:15:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwR7/FWAXg7d4zr+MFHgmXhg2Iw3NSBpT+cPDea9YgZ1f+ATpwLH6MLLp/1SWzV07p5w58 X-Received: by 2002:a17:906:1947:: with SMTP id b7mr12085929eje.320.1591956929574; Fri, 12 Jun 2020 03:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591956929; cv=none; d=google.com; s=arc-20160816; b=fEHO6+LthlroslSuvmehfu4nffG/bSZn6III3oVdU3BI5gv5fAcDvXg/xq1SBV3poi r0yfy2Lutj/m/PKtZ2B2QZhAqJCnBw3a3/WpF/lAU4vbRtVhBfqJsG48KnpZQIghAgHb LSh9TfXpJmFB9AbHOT2HvrWt0wn1cnWslN77oPMZZyBUdSxNHQCR40hxfp5fKDoIanVP hw0E63S+nFFaruYULghSxG9Z34S9yzwUY1kEDUXlJbMuHjSi0Vp+YGyJOMcIeat8jlnS bWcz7mj7yai+38BULn4tAThQqQRJN/2khBgRqUN7FfgiYm4NIaLw2QZ8SySlk7e+986b LtmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=2G642WIHg6CzjXXmjyVuUak54TDv5LjagJAnKexyH74=; b=oawYBng75D1kO1KvyuNBJaw4s7WBXHM7Z14ze5HeIDMu1MVrIPhzNrL8WDU2V5n7Ay 7TIenqky84qgIHuxN9+xvK0pG7fcuWsSLyoVNflpnivIVjOpNdosI3D3koNdvXTojdns xwI50bSRxFAaeGm7Soii3kZQCHKEeK0klFErYUBLd2x0wE1RqYeO2MVbG9PmTqOBbCSY A6otAXyrpRGvsJ4VOoc/AzYaidZgMXcbnT/W17BjpTDrCuXLORZjRIJatwMLRa96zgYU 2ht5TLtiqXEZYUbxwzDAv0rULeP/HnDwCVDjeXNA2x6FYRUlpdIfndGjn4D3LiAD2zDm Co2g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf24si3456444ejb.80.2020.06.12.03.15.05; Fri, 12 Jun 2020 03:15:29 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726253AbgFLKNR (ORCPT + 99 others); Fri, 12 Jun 2020 06:13:17 -0400 Received: from lgeamrelo13.lge.com ([156.147.23.53]:51495 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725868AbgFLKNO (ORCPT ); Fri, 12 Jun 2020 06:13:14 -0400 X-Greylist: delayed 1799 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Jun 2020 06:13:14 EDT Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.53 with ESMTP; 12 Jun 2020 18:43:11 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: hyc.lee@gmail.com Received: from unknown (HELO localhost.localdomain) (10.177.225.35) by 156.147.1.121 with ESMTP; 12 Jun 2020 18:43:11 +0900 X-Original-SENDERIP: 10.177.225.35 X-Original-MAILFROM: hyc.lee@gmail.com From: Hyunchul Lee To: Namjae Jeon , Sungjong Seo Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: [PATCH 1/2] exfat: call sync_filesystem for read-only remount Date: Fri, 12 Jun 2020 18:42:49 +0900 Message-Id: <20200612094250.9347-1-hyc.lee@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to commit dirty metadata and pages to disk before remounting exfat as read-only. This fixes a failure in xfstests generic/452 Signed-off-by: Hyunchul Lee --- fs/exfat/super.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fs/exfat/super.c b/fs/exfat/super.c index e650e65536f8..61c6cf240c19 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -693,10 +693,29 @@ static void exfat_free(struct fs_context *fc) } } +static int exfat_reconfigure(struct fs_context *fc) +{ + struct super_block *sb = fc->root->d_sb; + int ret; + bool new_rdonly; + + new_rdonly = fc->sb_flags & SB_RDONLY; + if (new_rdonly != sb_rdonly(sb)) { + if (new_rdonly) { + /* volume flag will be updated in exfat_sync_fs */ + ret = sync_filesystem(sb); + if (ret < 0) + return ret; + } + } + 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.17.1