ext2: handle sparse files correctly #38

Open
opened 2025-02-20 11:44:55 +02:00 by alnyan · 0 comments
Owner

When there is a full block of zeroes in a file, Linux chooses to point the block at #0 instead of actually allocating and writing an all-zeroes block, which is quite smart, but breaks with my ext2 driver. Fix that by assuming that if there's a block pointing to #0 and it's within the valid range of an inode, it's read as all zeroes. Handle writes appropriately as well

When there is a full block of zeroes in a file, Linux chooses to point the block at `#0` instead of actually allocating and writing an all-zeroes block, which is quite smart, but breaks with my ext2 driver. Fix that by assuming that if there's a block pointing to `#0` and it's within the valid range of an inode, it's read as all zeroes. Handle writes appropriately as well
alnyan added the
scope
kernel
driver
filesystem
bug
misbehavior
labels 2025-02-20 11:44:55 +02:00
Sign in to join this conversation.
No description provided.