git: msdosfs: fix #3237 where reading the last sector of a file returned 0s

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Jan 27 17:16:08 PST 2021


commit b406b8c284a599e6d288c6306f1a4180c2587138
Author: Krzysztof Piecuch <piecuch at kpiecuch.pl>
Date:   Wed Jan 27 23:38:33 2021 +0000

    msdosfs: fix #3237 where reading the last sector of a file returned 0s
    
    cluster_readx would load the correct data to cache except for the last
    sector of a file, where the cache was filled with zeroes.
    
    On small files (2 clusters) cluster_readx wouldn't even call
    msdosfs_bmap, correctly read first cluster and return zeroes for the
    second cluster.
    
    Fix this by telling cluster_readx that the file is bigger than it
    is. cluster_readx's `nblk` will then include the last sector.

Summary of changes:
 sys/vfs/msdosfs/msdosfs_vnops.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b406b8c284a599e6d288c6306f1a4180c2587138


-- 
DragonFly BSD source repository


More information about the Commits mailing list