• Thomas Fitzsimmons's avatar
    fs: ext4: Prevent infinite loop in ext4fs_iterate_dir · 54d68e93
    Thomas Fitzsimmons authored
    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: 's avatarThomas Fitzsimmons <fitzsim@cisco.com>
    Reviewed-by: 's avatarStefan Roese <sr@denx.de>
    54d68e93
Name
Last commit
Last update
..
cbfs Loading commit data...
cramfs Loading commit data...
ext4 Loading commit data...
fat Loading commit data...
jffs2 Loading commit data...
reiserfs Loading commit data...
sandbox Loading commit data...
ubifs Loading commit data...
yaffs2 Loading commit data...
zfs Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
fs.c Loading commit data...