Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH v2] xfs: check if reserved free disk blocks is needed
@ 2020-04-07  2:05 xiakaixu1987
  2020-04-07  6:38 ` Dave Chinner
  2020-04-08 14:12 ` Eric Sandeen
  0 siblings, 2 replies; 3+ messages in thread
From: xiakaixu1987 @ 2020-04-07  2:05 UTC (permalink / raw)
  To: linux-xfs; +Cc: darrick.wong, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

We share an inode between gquota and pquota with the older
superblock that doesn't have separate pquotino, and for the
need_alloc == false case we don't need to call xfs_dir_ialloc()
function, so add the check if reserved free disk blocks is
needed.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
---
v2:
 - improve the commit log.

 fs/xfs/xfs_qm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 6678baa..b684b04 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -780,7 +780,8 @@ struct xfs_qm_isolate {
 	}
 
 	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create,
-			XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp);
+			need_alloc ? XFS_QM_QINOCREATE_SPACE_RES(mp) : 0,
+			0, 0, &tp);
 	if (error)
 		return error;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xfs: check if reserved free disk blocks is needed
  2020-04-07  2:05 [PATCH v2] xfs: check if reserved free disk blocks is needed xiakaixu1987
@ 2020-04-07  6:38 ` Dave Chinner
  2020-04-08 14:12 ` Eric Sandeen
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2020-04-07  6:38 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: linux-xfs, darrick.wong, Kaixu Xia

On Tue, Apr 07, 2020 at 10:05:24AM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> We share an inode between gquota and pquota with the older
> superblock that doesn't have separate pquotino, and for the
> need_alloc == false case we don't need to call xfs_dir_ialloc()
> function, so add the check if reserved free disk blocks is
> needed.
> 
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> ---
> v2:
>  - improve the commit log.
> 
>  fs/xfs/xfs_qm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 6678baa..b684b04 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -780,7 +780,8 @@ struct xfs_qm_isolate {
>  	}
>  
>  	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create,
> -			XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp);
> +			need_alloc ? XFS_QM_QINOCREATE_SPACE_RES(mp) : 0,
> +			0, 0, &tp);

looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xfs: check if reserved free disk blocks is needed
  2020-04-07  2:05 [PATCH v2] xfs: check if reserved free disk blocks is needed xiakaixu1987
  2020-04-07  6:38 ` Dave Chinner
@ 2020-04-08 14:12 ` Eric Sandeen
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2020-04-08 14:12 UTC (permalink / raw)
  To: xiakaixu1987, linux-xfs; +Cc: darrick.wong, Kaixu Xia

On 4/6/20 9:05 PM, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> We share an inode between gquota and pquota with the older
> superblock that doesn't have separate pquotino, and for the
> need_alloc == false case we don't need to call xfs_dir_ialloc()
> function, so add the check if reserved free disk blocks is
> needed.
> 
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> ---
> v2:
>  - improve the commit log.

I wonder if we can improve the very generic summary, too ;)
maybe something like:

xfs: reserve quota inode transaction space only when needed

but in any case,

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

>  fs/xfs/xfs_qm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 6678baa..b684b04 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -780,7 +780,8 @@ struct xfs_qm_isolate {
>  	}
>  
>  	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create,
> -			XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp);
> +			need_alloc ? XFS_QM_QINOCREATE_SPACE_RES(mp) : 0,
> +			0, 0, &tp);
>  	if (error)
>  		return error;
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-08 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07  2:05 [PATCH v2] xfs: check if reserved free disk blocks is needed xiakaixu1987
2020-04-07  6:38 ` Dave Chinner
2020-04-08 14:12 ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox