aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-10-28 16:06:47 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-10-28 16:06:47 +0000
commit8c7d1e432a3f9c27a599e5e58e78664d300d9340 (patch)
tree5473fdf5e3b85fcc0639c4aa4937da144b5abace /target/linux/generic
parenta7dc820bf857c6d2d447c6c8fc5d98fef2ecc8e8 (diff)
downloadmaster-187ad058-8c7d1e432a3f9c27a599e5e58e78664d300d9340.tar.gz
master-187ad058-8c7d1e432a3f9c27a599e5e58e78664d300d9340.tar.bz2
master-187ad058-8c7d1e432a3f9c27a599e5e58e78664d300d9340.zip
kernel: jffs2: ignore bad blocks after the end-of-filesystem marker
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38568 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch13
-rw-r--r--target/linux/generic/patches-3.12/532-jffs2_eofdetect.patch13
2 files changed, 16 insertions, 10 deletions
diff --git a/target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch b/target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch
index f36131e99f..269179063c 100644
--- a/target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch
+++ b/target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch
@@ -19,21 +19,24 @@
/* Now scan the directory tree, increasing nlink according to every dirent found. */
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
-@@ -148,8 +148,11 @@ int jffs2_scan_medium(struct jffs2_sb_in
+@@ -148,8 +148,14 @@ int jffs2_scan_medium(struct jffs2_sb_in
/* reset summary info for next eraseblock scan */
jffs2_sum_reset_collected(s);
- ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
- buf_size, s);
-+ if (c->flags & (1 << 7))
-+ ret = BLK_STATE_ALLFF;
-+ else
++ if (c->flags & (1 << 7)) {
++ if (mtd_block_isbad(c->mtd, jeb->offset))
++ ret = BLK_STATE_BADBLOCK;
++ else
++ ret = BLK_STATE_ALLFF;
++ } else
+ ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
+ buf_size, s);
if (ret < 0)
goto out;
-@@ -556,6 +559,17 @@ static int jffs2_scan_eraseblock (struct
+@@ -556,6 +562,17 @@ static int jffs2_scan_eraseblock (struct
return err;
}
diff --git a/target/linux/generic/patches-3.12/532-jffs2_eofdetect.patch b/target/linux/generic/patches-3.12/532-jffs2_eofdetect.patch
index f36131e99f..269179063c 100644
--- a/target/linux/generic/patches-3.12/532-jffs2_eofdetect.patch
+++ b/target/linux/generic/patches-3.12/532-jffs2_eofdetect.patch
@@ -19,21 +19,24 @@
/* Now scan the directory tree, increasing nlink according to every dirent found. */
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
-@@ -148,8 +148,11 @@ int jffs2_scan_medium(struct jffs2_sb_in
+@@ -148,8 +148,14 @@ int jffs2_scan_medium(struct jffs2_sb_in
/* reset summary info for next eraseblock scan */
jffs2_sum_reset_collected(s);
- ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
- buf_size, s);
-+ if (c->flags & (1 << 7))
-+ ret = BLK_STATE_ALLFF;
-+ else
++ if (c->flags & (1 << 7)) {
++ if (mtd_block_isbad(c->mtd, jeb->offset))
++ ret = BLK_STATE_BADBLOCK;
++ else
++ ret = BLK_STATE_ALLFF;
++ } else
+ ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
+ buf_size, s);
if (ret < 0)
goto out;
-@@ -556,6 +559,17 @@ static int jffs2_scan_eraseblock (struct
+@@ -556,6 +562,17 @@ static int jffs2_scan_eraseblock (struct
return err;
}