diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-04-04 13:59:11 +0300 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-17 14:05:48 -0400 |
commit | 10731f83009e2556f98ffa5c7c2cbffe66dacfb3 (patch) | |
tree | 8b3f3c446e82e06ab1794af7e1c04bf300f3b023 /fs/jffs2/scan.c | |
parent | 7f762ab24ca2215b69a1395b5b58877f8282a089 (diff) | |
download | op-kernel-dev-10731f83009e2556f98ffa5c7c2cbffe66dacfb3.zip op-kernel-dev-10731f83009e2556f98ffa5c7c2cbffe66dacfb3.tar.gz |
[JFFS2] fix buffer sise calculations in jffs2_get_inode_nodes()
In read inode we have an optimization which prevents one
min. I/O unit (e.g. NAND page) to be read more then once.
Namely, at the beginning we do not know which node type we read,
so we read so we assume we read the directory entry, because it
has the smallest node header. When we read it, we read up to the
next min. I/O unit, just because if later we'll need to read more,
we already have this data.
If it turns out to be that the node is not directory entry, and
we need more data, and we did not read it because it sits in the
next min. I/O unit, we read the whole next (or several next)
min. I/O unit(s). And if it happens to be that we read a data node,
and we've read part of its data, we calculate partial CRC.
So if later we need to check data CRC, we'll only read the rest
of the data from further min. I/O units and continue CRC checking.
This code was a bit messy and buggy. The bug was that it assumed
relatively large min. I/O unit, so that the largest node header
could overlap only one min. I/O unit boundary.
This parch clean-ups the code a bit and fixes this bug.
The patch was not tested on flash with small min. I/O unit, like
NOR-ECC, nut it was tested on NAND with 512 bytes NAND page, so
it at least does not break NAND. It was also tested with mtdram
so it should not break NOR.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/scan.c')
0 files changed, 0 insertions, 0 deletions