diff mbox series

[v3,09/14] xfs: Update xfs_setattr_size() for forcealign

Message ID 20240801163057.3981192-10-john.g.garry@oracle.com (mailing list archive)
State New
Headers show
Series forcealign for xfs | expand

Commit Message

John Garry Aug. 1, 2024, 4:30 p.m. UTC
For when an inode has forcealign, reserve blocks for same reason which we
were doing for big RT alloc.

Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 fs/xfs/xfs_iops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong Aug. 6, 2024, 7:03 p.m. UTC | #1
On Thu, Aug 01, 2024 at 04:30:52PM +0000, John Garry wrote:
> For when an inode has forcealign, reserve blocks for same reason which we
> were doing for big RT alloc.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_iops.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index 1cdc8034f54d..6e017aa6f61d 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -926,12 +926,12 @@ xfs_setattr_size(
>  	}
>  
>  	/*
> -	 * For realtime inode with more than one block rtextsize, we need the
> +	 * For inodes with more than one block alloc unitsize, we need the
>  	 * block reservation for bmap btree block allocations/splits that can
>  	 * happen since it could split the tail written extent and convert the
>  	 * right beyond EOF one to unwritten.
>  	 */
> -	if (xfs_inode_has_bigrtalloc(ip))
> +	if (xfs_inode_alloc_fsbsize(ip) > 1)
>  		resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
>  
>  	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, resblks,
> -- 
> 2.31.1
> 
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 1cdc8034f54d..6e017aa6f61d 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -926,12 +926,12 @@  xfs_setattr_size(
 	}
 
 	/*
-	 * For realtime inode with more than one block rtextsize, we need the
+	 * For inodes with more than one block alloc unitsize, we need the
 	 * block reservation for bmap btree block allocations/splits that can
 	 * happen since it could split the tail written extent and convert the
 	 * right beyond EOF one to unwritten.
 	 */
-	if (xfs_inode_has_bigrtalloc(ip))
+	if (xfs_inode_alloc_fsbsize(ip) > 1)
 		resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);
 
 	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, resblks,