]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: reclaim speculative preallocations for append only files xfs-eofblocks-fix
authorChristoph Hellwig <hch@lst.de>
Sat, 22 Jun 2024 14:49:41 +0000 (16:49 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 7 Aug 2024 15:55:05 +0000 (08:55 -0700)
commitf7e739ddbd8eef221171d6972592798e4291e36d
tree6d5f24d8c37d62371024de0aeb8cb8b682d3a8ed
parent0082a8ebab43c16090bf3b2f7a9f6e112afbda14
xfs: reclaim speculative preallocations for append only files

The XFS XFS_DIFLAG_APPEND maps to the VFS S_APPEND flag, which forbids
writes that don't append at the current EOF.

But the commit originally adding XFS_DIFLAG_APPEND support (commit
a23321e766d in xfs xfs-import repository) also checked it to skip
releasing speculative preallocations, which doesn't make any sense.

Another commit (dd9f438e3290 in the xfs-import repository) later extended
that flag to also report these speculation preallocations which should
not exist in getbmap.

Remove these checks as nothing XFS_DIFLAG_APPEND implies that
preallocations beyond EOF should exist, but explicitly check for
XFS_DIFLAG_APPEND in xfs_file_release to bypass the algorithm that
discard preallocations on the first close as append only files aren't
expected to be written to only once.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_file.c
fs/xfs/xfs_icache.c