diff options
author | Christoph Hellwig <hch@lst.de> | 2024-06-19 19:32:43 +0200 |
---|---|---|
committer | Chandan Babu R <chandanbabu@kernel.org> | 2024-06-26 10:59:17 +0200 |
commit | 610b29161b0aa9feb59b78dc867553274f17fb01 (patch) | |
tree | acd19cf33623c4c800bb1da82537c1f15e69e992 /fs/xfs/xfs_icache.c | |
parent | Linux 6.10-rc5 (diff) | |
download | linux-610b29161b0aa9feb59b78dc867553274f17fb01.tar.xz linux-610b29161b0aa9feb59b78dc867553274f17fb01.zip |
xfs: fix freeing speculative preallocations for preallocated files
xfs_can_free_eofblocks returns false for files that have persistent
preallocations unless the force flag is passed and there are delayed
blocks. This means it won't free delalloc reservations for files
with persistent preallocations unless the force flag is set, and it
will also free the persistent preallocations if the force flag is
set and the file happens to have delayed allocations.
Both of these are bad, so do away with the force flag and always free
only post-EOF delayed allocations for files with the XFS_DIFLAG_PREALLOC
or APPEND flags set.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r-- | fs/xfs/xfs_icache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 0953163a2d84..9967334ea99f 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1155,7 +1155,7 @@ xfs_inode_free_eofblocks( } *lockflags |= XFS_IOLOCK_EXCL; - if (xfs_can_free_eofblocks(ip, false)) + if (xfs_can_free_eofblocks(ip)) return xfs_free_eofblocks(ip); /* inode could be preallocated or append-only */ |