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-04 07:57:39 +1200
commit8670595b355e66200c97aa1668af04d4eaebaa6b (patch)
tree86f491007675cb291fccf63951a08583209a2546
parent1c179647cc26bcc05144dab770f4576979ad7152 (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) {