diff mbox

UBIFS: Remove useless @ecc in struct ubifs_scan_leb

Message ID 53A8F49C.9000805@huawei.com
State Accepted
Headers show

Commit Message

hujianyang June 24, 2014, 3:46 a.m. UTC
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.


Signed-off-by: hujianyang <hujianyang@huawei.com>
---
 fs/ubifs/scan.c  | 7 +++++--
 fs/ubifs/ubifs.h | 2 --
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

hujianyang July 1, 2014, 1:19 a.m. UTC | #1
ping?
Artem Bityutskiy July 1, 2014, 2:32 p.m. UTC | #2
On Tue, 2014-06-24 at 11:46 +0800, hujianyang wrote:
> 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!
diff mbox

Patch

diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c
index 58aa05d..5468836 100644
--- a/fs/ubifs/scan.c
+++ b/fs/ubifs/scan.c
@@ -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;
 }
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index c1f71fe..977a01b 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -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;
 };