]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: fix file size setting when interpreting a protofile
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:40:24 +0000 (14:40 -0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 5 Feb 2025 17:20:02 +0000 (18:20 +0100)
commita62ea4ad9cacac5fa82c0df45b3f7248cf255d9c
tree8cdbdd75f6a029d896f466232385ce3b5283c819
parentca10888d51a51ccb8ef02c9182c554eee4493aac
mkfs: fix file size setting when interpreting a protofile

When we're copying a regular file into the filesystem, we should set the
size of the new file to the size indicated by the stat data, not the
highest offset written, because we now use SEEK_DATA/HOLE to ignore
sparse regions.

Fixes: 73fb78e5ee8940 ("mkfs: support copying in large or sparse files")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
mkfs/proto.c