]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: fix missing error check in xfs_rtfree_range in libxfs
authorDave Chinner <david@fromorbit.com>
Mon, 18 Jan 2010 00:08:50 +0000 (11:08 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 18 Jan 2010 00:08:50 +0000 (11:08 +1100)
When xfs_rtfind_forw() returns an error, the block is returned
uninitialised.  xfs_rtfree_range() is not checking the error return,
so could be using an uninitialised block number for modifying bitmap
summary info.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_rtalloc.c

index 6c3da528f4350871263277189e8f07e5327c21f4..4fbdaa9d2964ad0652aa52b548b2125c79439471 100644 (file)
@@ -466,6 +466,8 @@ xfs_rtfree_range(
         */
        error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1,
                &postblock);
+       if (error)
+               return error;
        /*
         * If there are blocks not being freed at the front of the
         * old extent, add summary data for them to be allocated.