xfs
[Top] [All Lists]

Re: [PATCH] xfs: always set rvalp in xfs_dir2_node_trim_free

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs: always set rvalp in xfs_dir2_node_trim_free
From: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Date: Fri, 11 Mar 2016 12:05:54 +0100
Cc: hch@xxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1457689337-4018-1-git-send-email-hch@xxxxxx>
Mail-followup-to: xfs@xxxxxxxxxxx, hch@xxxxxx
References: <1457689337-4018-1-git-send-email-hch@xxxxxx>
User-agent: Mutt/1.5.24 (2015-08-30)
I was just sending this patch when I saw yours.

Looks good to me:

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>

On Fri, Mar 11, 2016 at 10:42:17AM +0100, Christoph Hellwig wrote:
> xfs_dir2_node_trim_free can return with setting the rvalp argument
> pointer.  Initialize it to 0 at the beginning of the function and
> only update it to 1 if we succeeded trimming a freespace block.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
>  fs/xfs/libxfs/xfs_dir2_node.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_node.c b/fs/xfs/libxfs/xfs_dir2_node.c
> index 63ee03d..75a5574 100644
> --- a/fs/xfs/libxfs/xfs_dir2_node.c
> +++ b/fs/xfs/libxfs/xfs_dir2_node.c
> @@ -2235,6 +2235,9 @@ xfs_dir2_node_trim_free(
>  
>       dp = args->dp;
>       tp = args->trans;
> +
> +     *rvalp = 0;
> +
>       /*
>        * Read the freespace block.
>        */
> @@ -2255,7 +2258,6 @@ xfs_dir2_node_trim_free(
>        */
>       if (freehdr.nused > 0) {
>               xfs_trans_brelse(tp, bp);
> -             *rvalp = 0;
>               return 0;
>       }
>       /*
> -- 
> 2.1.4
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
Carlos

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