Skip to contentSkip to conversation

UBIFS: Remove useless @ecc in struct ubifs_scan_leb

PATCH Applied hujianyang 2 participants 3 messages Jun 24, 2014 – Jul 1, 2014

Subsystems (2)
lore
Share & tools
lore

hujianyang

author
#0 lore raw

PATCH 1/1 UBIFS: Remove useless @ecc in struct ubifs_scan_leb

We set @ecc in ubifs_scan_leb only if leb_read returns EBADMSG and do not use it any more. This patch removes this variable and adds comments about EBADMSG handling.

---
 fs/ubifs/scan.c  | 7 +++++--
 fs/ubifs/ubifs.h | 2 --
 2 files changed, 5 insertions(+), 4 deletions(-)
fs/ubifs/scan.c +5 -2
index 58aa05d..5468836 100644
@@ -157,8 +157,11 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
 		return ERR_PTR(err);
 	}
 
-	if (err == -EBADMSG)
-		sleb->ecc = 1;
+	/*
+	 * If err == -EBADMSG, we scan this leb first because we
+	 * can detect corruptions by checking NODEs and return an
+	 * error if it is really corruptted.
+	 */
 
 	return sleb;
 }
fs/ubifs/ubifs.h +0 -2
index c1f71fe..977a01b 100644
@@ -314,7 +314,6 @@ struct ubifs_scan_node {
  * @nodes_cnt: number of nodes scanned
  * @nodes: list of struct ubifs_scan_node
  * @endpt: end point (and therefore the start of empty space)
- * @ecc: read returned -EBADMSG
  * @buf: buffer containing entire LEB scanned
  */
 struct ubifs_scan_leb {
@@ -322,7 +321,6 @@ struct ubifs_scan_leb {
 	int nodes_cnt;
 	struct list_head nodes;
 	int endpt;
-	int ecc;
 	void *buf;
 };
 
Signature · 1 line
1.8.1.4
#2 lore raw
In reply to hujianyang
Quoted 3 lines · hujianyang

We set @ecc in ubifs_scan_leb only if leb_read returns EBADMSG and do not use it any more. This patch removes this variable and adds comments about EBADMSG handling.

Pushed to linux-ubifs.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy