summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Manning <cdhmanning@gmail.com>2011-04-04 07:57:39 +1200
committerCharles Manning <cdhmanning@gmail.com>2011-04-28 16:07:41 +1200
commitce2c1ba4eba2b445c8a9c871eebe1c71b4303fd1 (patch)
tree64fb311ea9da3802c8c0be6e86f4c8a501a132f9
parent8e0281ff8c5904d1dbb5b41f3cfadfb05f139437 (diff)
yaffs: Discard partially written summary data
A power failure during the write of a multi-chunk summary can leave stuff lying around that looks like part of a file. If this is detected then delete it. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
-rw-r--r--yaffs_yaffs2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/yaffs_yaffs2.c b/yaffs_yaffs2.c
index 093e485..5761e96 100644
--- a/yaffs_yaffs2.c
+++ b/yaffs_yaffs2.c
@@ -1023,6 +1023,7 @@ static inline int yaffs2_scan_chunk(struct yaffs_dev *dev,
dev->n_free_chunks++;
} else if (tags.obj_id > YAFFS_MAX_OBJECT_ID ||
tags.chunk_id > YAFFS_MAX_CHUNK_ID ||
+ tags.obj_id == YAFFS_OBJECTID_SUMMARY ||
(tags.chunk_id > 0 &&
tags.n_bytes > dev->data_bytes_per_chunk) ||
tags.seq_number != bi->seq_number) {