diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-10-28 16:06:47 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-10-28 16:06:47 +0000 |
commit | 32a2f9a1c35b5308cfa225f8ef23f2b1cd000240 (patch) | |
tree | 87b588ac593ffd49175a3d07dbef8baaf82a931b /target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch | |
parent | 3f6a5c862b7df49aa7db871bb486c9e967f72d79 (diff) | |
download | upstream-32a2f9a1c35b5308cfa225f8ef23f2b1cd000240.tar.gz upstream-32a2f9a1c35b5308cfa225f8ef23f2b1cd000240.tar.bz2 upstream-32a2f9a1c35b5308cfa225f8ef23f2b1cd000240.zip |
kernel: jffs2: ignore bad blocks after the end-of-filesystem marker
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 38568
Diffstat (limited to 'target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch')
-rw-r--r-- | target/linux/generic/patches-3.10/532-jffs2_eofdetect.patch | 13 |
1 files changed, 8 insertions, 5 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; } |