From: hujianyang <hujianyang@huawei.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: [PATCH] UBIFS: Remove useless @ecc in struct ubifs_scan_leb
Date: Tue, 24 Jun 2014 11:46:36 +0800 [thread overview]
Message-ID: <53A8F49C.9000805@huawei.com> (raw)
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(-)
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;
};
--
1.8.1.4
next reply other threads:[~2014-06-24 3:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 3:46 hujianyang [this message]
2014-07-01 1:19 ` [PATCH] UBIFS: Remove useless @ecc in struct ubifs_scan_leb hujianyang
2014-07-01 14:32 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53A8F49C.9000805@huawei.com \
--to=hujianyang@huawei.com \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.