]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: always set rvalp in xfs_dir2_node_trim_free
authorChristoph Hellwig <hch@lst.de>
Tue, 21 Jun 2016 05:56:34 +0000 (15:56 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 21 Jun 2016 05:56:34 +0000 (15:56 +1000)
Source kernel commit 355cced45286ed7e710058174066628ff9ad9fa4

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.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_dir2_node.c

index 224daa634ff4998b8d762b1083529e6c8ee60ba1..df599f97f6e6752d657cf8816c9bac708a225fa4 100644 (file)
@@ -2230,6 +2230,9 @@ xfs_dir2_node_trim_free(
 
        dp = args->dp;
        tp = args->trans;
+
+       *rvalp = 0;
+
        /*
         * Read the freespace block.
         */
@@ -2250,7 +2253,6 @@ xfs_dir2_node_trim_free(
         */
        if (freehdr.nused > 0) {
                xfs_trans_brelse(tp, bp);
-               *rvalp = 0;
                return 0;
        }
        /*