]> git.baikalelectronics.ru Git - uboot.git/commit
JFFS2: fix jffs2 summary datacrc status uninitialized
authorWagner Popov dos Santos <wpopov@gmail.com>
Tue, 23 Feb 2021 03:49:00 +0000 (00:49 -0300)
committerTom Rini <trini@konsulko.com>
Wed, 7 Apr 2021 14:22:22 +0000 (10:22 -0400)
commit0c7920dca72239f14fcaaff378a234fb1c7a1f21
treee41615bb0ce59e7114f1db4852a73a4c3df08219
parentd9c900cee5fa6dacbdd3fca37c1ae955ab4f4355
JFFS2: fix jffs2 summary datacrc status uninitialized

The function jffs2_1pass_read_inode() was discarding the summary
inodes and dirent because the value in datacrc flag wasn't
initialized in function jffs2_sum_process_sum_data().

This fix initializes the status of all summary records to indicate
that the CRC needs to be verified when they are loaded.

Before this fix, the behaviors produced by the undefined value of
datacrc was:
- Summary's registries were discarded when 'b->datacrc' is equal
  as 'CRC_BAD'.
- Summary's registries were not checked when b->datacrc differs of
  'CRC_BAD' and 'CRC_UNKNOWN'

So, almost all of the time the crc just isn't checked, and in some
cases the registries are discarded.

Signed-off-by: Wagner Popov dos Santos <wpopov@gmail.com>
fs/jffs2/jffs2_1pass.c