Skip to content

Commit 8944c6f

Browse files
author
Darrick J. Wong
committed
xfs: dont treat rt extents beyond EOF as eofblocks to be cleared
On a system with a realtime volume and a 28k realtime extent, generic/491 fails because the test opens a file on a frozen filesystem and closing it causes xfs_release -> xfs_can_free_eofblocks to mistakenly think that the the blocks of the realtime extent beyond EOF are posteof blocks to be freed. Realtime extents cannot be partially unmapped, so this is pointless. Worse yet, this triggers posteof cleanup, which stalls on a transaction allocation, which is why the test fails. Teach the predicate to account for realtime extents properly. Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
1 parent e53bcff commit 8944c6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/xfs/xfs_bmap_util.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ xfs_can_free_eofblocks(
686686
* forever.
687687
*/
688688
end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_ISIZE(ip));
689+
if (XFS_IS_REALTIME_INODE(ip) && mp->m_sb.sb_rextsize > 1)
690+
end_fsb = roundup_64(end_fsb, mp->m_sb.sb_rextsize);
689691
last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
690692
if (last_fsb <= end_fsb)
691693
return false;

0 commit comments

Comments
 (0)