I stumbled across a bug in the FAT32 root directory handling. I
generated a simple patch, but then found that the same bug existed in
u-boot, and has already been fixed by Erik Hansen. Should I try to
port his patch to x-loader, or is someone already working on this?
The following is the commit log for Erik Hansen's patch:
fat32 root directory handling
Fat directory handling didn't check reaching the end of the root
relied on a stop condition based on a directory entry with a name
a '\0' character. This check in itself is wrong ('\0' indicates free
end_of_directory) but outside the scope of this fix. For FAT32, the
end of the
rootdir is reached when the end of the cluster chain is reached. The
check this condition and started to read an incorrect cluster. This
subsequent read request of a sector outside the range of the usb stick
use. On its turn, the usb stick protested with a stall handshake.
Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been