From liaohua4@huawei.com Tue May 19 02:46:05 2020 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by stoneboat.default.lvansomeren.uk0.bigv.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jarKQ-0006Lv-TG for yaffs@stoneboat.aleph1.co.uk; Tue, 19 May 2020 02:46:05 +0100 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2BF4D2D27D1DD4BBE163 for ; Tue, 19 May 2020 09:45:51 +0800 (CST) Received: from DESKTOP-D70G4DM.china.huawei.com (10.67.101.5) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 19 May 2020 09:45:45 +0800 From: Liao Hua To: , CC: , Date: Tue, 19 May 2020 09:43:07 +0800 Message-ID: <20200519014306.3252-1-liaohua4@huawei.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.101.5] X-CFilter-Loop: Reflected X-Spam_score: -103.8 X-Spam_score_int: -1037 X-Spam_bar: --------------------------------------------------- X-Spam_report: Spam detection software, running on the system "stoneboat.default.lvansomeren.uk0.bigv.io", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: liaohua If the dev is remounted ro, no checkpoint data is saved. And that will increase the time for next mount. Signed-off-by: liaohua --- yaffs_vfs_multi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Content analysis details: (-103.8 points, 4.9 required) pts rule name description ---- ---------------------- -------------------------------------------------- -100 USER_IN_WHITELIST From: address is in the user's white-list -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.32 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.4 AWL AWL: Adjusted score from AWL reputation of From: address X-ACL-Warn: warn X-SA-Exim-Connect-IP: 45.249.212.32 X-SA-Exim-Mail-From: liaohua4@huawei.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on stoneboat.default.lvansomeren.uk0.bigv.io X-Spam-Level: X-Spam-Status: No, score=-103.8 required=4.9 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, USER_IN_WHITELIST autolearn=unavailable autolearn_force=no version=3.4.2 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on stoneboat.default.lvansomeren.uk0.bigv.io) Subject: [Yaffs] [PATCH] Flush super when remount ro in order to save checkpoint X-BeenThere: yaffs@stoneboat.aleph1.co.uk X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion of YAFFS NAND flash filesystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 01:46:06 -0000 From: liaohua If the dev is remounted ro, no checkpoint data is saved. And that will increase the time for next mount. Signed-off-by: liaohua --- yaffs_vfs_multi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 3044db7..5956a24 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -2749,14 +2749,20 @@ static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data) dev = sb->s_fs_info; was_read_only = dev->read_only; - dev->read_only = read_only; if (was_read_only && !read_only) { yaffs_gross_lock(dev); + dev->read_only = read_only; + yaffs_bg_enable = 1; yaffs_guts_cleanup(dev); yaffs_gross_unlock(dev); yaffs_bg_start(dev); } else if (!was_read_only && read_only) { + yaffs_gross_lock(dev); + yaffs_bg_enable = 0; + yaffs_flush_super(sb, 1); + dev->read_only = read_only; + yaffs_gross_unlock(dev); yaffs_bg_stop(dev); } -- 2.26.2.windows.1