]> Git Repo - linux.git/commitdiff
xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent
authorChristoph Hellwig <[email protected]>
Wed, 11 May 2011 15:04:05 +0000 (15:04 +0000)
committerAlex Elder <[email protected]>
Wed, 25 May 2011 15:48:38 +0000 (10:48 -0500)
The code in xfs_bmap_del_extent does not correctly decrement the
extent buffer index when deleting a whole extent.  Most of the time
this gets caught by checks in xfs_bmapi that work around it and
decrement it manually and thus wasn't noticed so far.

Based on an earlier patch from Lachlan McIlroy.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Lachlan McIlroy <[email protected]>
Signed-off-by: Alex Elder <[email protected]>
fs/xfs/xfs_bmap.c

index 896e16f08ed95b8c44df4928aa2280dd412d06a5..e546a33214c93b9d6d4e9e75450451c8592b40aa 100644 (file)
@@ -2916,8 +2916,10 @@ xfs_bmap_del_extent(
                 */
                xfs_iext_remove(ip, *idx, 1,
                                whichfork == XFS_ATTR_FORK ? BMAP_ATTRFORK : 0);
+               --*idx;
                if (delay)
                        break;
+
                XFS_IFORK_NEXT_SET(ip, whichfork,
                        XFS_IFORK_NEXTENTS(ip, whichfork) - 1);
                flags |= XFS_ILOG_CORE;
This page took 0.082302 seconds and 4 git commands to generate.