aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-05-11 15:04:05 +0000
committerAlex Elder <aelder@sgi.com>2011-05-25 10:48:38 -0500
commit233eebb9a96f956c541c0c9094fd321894bd93a7 (patch)
treefb7e2d79a0d79ae69e01023c525f6f11a6a07314 /fs/xfs
parent87bef1812d337beadfb1099e7361fd41264eb88e (diff)
downloadkernel_samsung_smdk4412-233eebb9a96f956c541c0c9094fd321894bd93a7.zip
kernel_samsung_smdk4412-233eebb9a96f956c541c0c9094fd321894bd93a7.tar.gz
kernel_samsung_smdk4412-233eebb9a96f956c541c0c9094fd321894bd93a7.tar.bz2
xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent
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 <hch@lst.de> Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_bmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 896e16f..e546a33 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -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;