am 61ba7a83: stop treating all-zero blocks as bad
Merge commit '61ba7a83ef46494689801ddaad569d7d174153b1' into gingerbread-plus-aosp * commit '61ba7a83ef46494689801ddaad569d7d174153b1': stop treating all-zero blocks as bad
This commit is contained in:
+1
-8
@@ -308,14 +308,7 @@ static int read_block(const MtdPartition *partition, int fd, char *data)
|
|||||||
"mtd: MEMGETBADBLOCK returned %d at 0x%08llx (errno=%d)\n",
|
"mtd: MEMGETBADBLOCK returned %d at 0x%08llx (errno=%d)\n",
|
||||||
mgbb, pos, errno);
|
mgbb, pos, errno);
|
||||||
} else {
|
} else {
|
||||||
int i;
|
return 0; // Success!
|
||||||
for (i = 0; i < size; ++i) {
|
|
||||||
if (data[i] != 0) {
|
|
||||||
return 0; // Success!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fprintf(stderr, "mtd: read all-zero block at 0x%08llx; skipping\n",
|
|
||||||
pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pos += partition->erase_size;
|
pos += partition->erase_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user