lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  2 Feb 2016 02:30:50 +0000
From:	Bean Huo <jackyard88@...il.com>
To:	richard@....at, dedekind1@...il.com, adrian.hunter@...el.com,
	computersforpeace@...il.com, boris.brezillon@...e-electrons.com
Cc:	beanhuo@...ron.com, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org, zszubbocsev@...ron.com,
	peterpandong@...ron.com
Subject: [PATCH v2 15/17] fs:ubifs:enable bakvol module and  recover operation

From: Bean Huo <beanhuo@...ron.com>

Before mounting, bakvol will do recovery operaion according to
master node flag(clearly unmount or not). If corrupted page damaged by
power loss exists, bakvol will reocover it through its backup page data.
bakvol module will be enable after ubifs mount successfully.

Signed-off-by: BeanHuo <beanhuo@...ron.com>
---
 fs/ubifs/super.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 9547a278..0aaeafa 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1270,6 +1270,11 @@ static int mount_ubifs(struct ubifs_info *c)
 		c->need_recovery = 1;
 	}
 
+#ifdef CONFIG_MTD_UBI_MLC_NAND_BAKVOL
+	if (c->need_recovery)
+		ubi_corrupted_data_recovery(c->ubi);
+#endif
+
 	if (c->need_recovery && !c->ro_mount) {
 		err = ubifs_recover_inl_heads(c, c->sbuf);
 		if (err)
@@ -1463,6 +1468,8 @@ static int mount_ubifs(struct ubifs_info *c)
 	dbg_gen("max. seq. number:    %llu", c->max_sqnum);
 	dbg_gen("commit number:       %llu", c->cmt_no);
 
+	init_bakvol(c->ubi, 1);
+
 	return 0;
 
 out_infos:
@@ -1774,6 +1781,10 @@ static void ubifs_put_super(struct super_block *sb)
 	 * the mutex is locked.
 	 */
 	mutex_lock(&c->umount_mutex);
+
+	/* Disable ubi MLC power loss backup function */
+	init_bakvol(c->ubi, 0);
+
 	if (!c->ro_mount) {
 		/*
 		 * First of all kill the background thread to make sure it does
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ