1
0
Fork 0
remarkable-uboot/fs
Thomas Fitzsimmons 54d68e9333 fs: ext4: Prevent infinite loop in ext4fs_iterate_dir
If the ext3 journal gets out of sync with what is written on disk, for
example because of an unexpected power cut, ext4fs_read_file can
return an all-zero directory entry.  In that case, ext4fs_iterate_dir
would infinite loop.

This patch detects when a directory entry's direntlen member is 0 and
returns a failure status, which breaks out of the infinite loop.  As a
result, U-Boot will not find files that may subsequently be recovered
when the journal is replayed.

This is better behaviour than hanging in an infinite loop, but as a
further improvement maybe U-Boot could interpret the ext3 journal and
actually find the unsynced entries.

Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2015-11-23 11:01:52 -05:00
..
cbfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
cramfs kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
ext4 fs: ext4: Prevent infinite loop in ext4fs_iterate_dir 2015-11-23 11:01:52 -05:00
fat fs/fat/fat_write: Fix management of empty files 2015-10-11 17:12:08 -04:00
jffs2 JFFS2: Use merge sort when parsing filesystem 2015-08-12 20:47:32 -04:00
reiserfs kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
sandbox sandbox: only do sandboxfs for hostfs interface 2015-04-19 14:45:56 -06:00
ubifs compat: Remove is_power_of_2() definition 2015-11-05 16:46:59 -05:00
yaffs2 Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
zfs ZFS: Clean up cppcheck warnings where relevant, leaked memory etc 2014-11-10 16:25:27 -05:00
Kconfig kconfig: add blank Kconfig files 2014-09-24 18:30:28 -04:00
Makefile spl: Add EXT support to SPL 2014-10-27 17:54:03 -04:00
fs.c ubifs: Add generic fs support 2015-10-24 13:50:32 -04:00