Bug #3237

msdosfs: can't properly read files longer than couple of kilobytes

Added by piecuch 28 days ago. Updated about 11 hours ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Reading a file from msdosfs reports valid data within the first couple of kilobytes, everything after that is only NULL bytes (or it might be some data from a different sector which is currently zeroed).

I have tested this on the following configurations:
write on Linux - corrupted data on dfly, correct data on Linux
write on dfly - corrupted data on dfly, correct data on Linux

I am running latest version from master.

I will see if this bug can be reproduced on freebsd and try to fix that/port stuff from freebsd. Hints welcome.



Updated by piecuch 28 days ago

FreeBSD can correctly read data written on both Linux and DFly, DFly cannot properly read files written from FreeBSD.

I forgot to mention that you need a reboot (or maybe some kind of cache flush) for the bug to surface.


Updated by tkusumi about 11 hours ago

Looks like inmemory buffer for data is somehow not landing ondisk, but can't reproduce it myself. Try fsck_msdosfs. I would presume fsck won't complain, meaning FAT clusters are in consistent state.

If this consistently (100% always) reproduces on FAT32 with a certain file size,

1) If you want to further investigate, you could try old kernels (probably before 2019 September) and try to see or bisect if it reproduces.
2) I'd recommend to write the exact repro here, e.g. newfs_msdos output (which contains FAT params), the exact command to write to a file, the exact command to find out a file with \0 data beyond which offset, etc.

Also available in: Atom PDF