xfs
[Top] [All Lists]

Re: [PATCH v2] xfs: remove XFS_TRANS_RESERVE in collapse range

To: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Subject: Re: [PATCH v2] xfs: remove XFS_TRANS_RESERVE in collapse range
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 13 May 2014 07:29:31 -0400
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <000f01cf6e3e$d4a0a800$7de1f800$@samsung.com>
References: <000f01cf6e3e$d4a0a800$7de1f800$@samsung.com>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, May 13, 2014 at 09:03:55AM +0900, Namjae Jeon wrote:
> There is no need to dip into reserve pool. Reserve pool is used for much
> more important things. And xfs_trans_reserve will never return ENOSPC
> because punch hole is already done. If we get ENOSPC, collapse range
> will be simply failed.
> 
> Cc: Brian Foster <bfoster@xxxxxxxxxx>
> Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> Signed-off-by: Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
> ---

Looks good, thanks Namjae!

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  fs/xfs/xfs_bmap_util.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 296160b..057f671 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -1519,7 +1519,6 @@ xfs_collapse_file_space(
>  
>       while (!error && !done) {
>               tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT);
> -             tp->t_flags |= XFS_TRANS_RESERVE;
>               /*
>                * We would need to reserve permanent block for transaction.
>                * This will come into picture when after shifting extent into
> @@ -1529,7 +1528,6 @@ xfs_collapse_file_space(
>               error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write,
>                               XFS_DIOSTRAT_SPACE_RES(mp, 0), 0);
>               if (error) {
> -                     ASSERT(error == ENOSPC || XFS_FORCED_SHUTDOWN(mp));
>                       xfs_trans_cancel(tp, 0);
>                       break;
>               }
> -- 
> 1.7.11-rc0
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>