Skip to content
Commit 5a5f05ba authored by Chen Shu's avatar Chen Shu Committed by Benjamin Cabé
Browse files

fs: ext2: Fix nbytes_to_read calculation in ext2_inode_read()



Fix incorrect nbytes_to_read calculation in ext2_inode_read() function.
Previously nbytes_to_read was decremented by read value which caused
incorrect calculation of bytes to read in subsequent iterations.
Now nbytes_to_read is decremented by to_read value which represents
the actual number of bytes read in current iteration.

This fixes potential data corruption issues when reading files from
ext2 filesystem.

Signed-off-by: default avatarChen Shu <751541594@qq.com>
parent 5de7e415
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment