提交 233eebb9 编写于 作者: C Christoph Hellwig 提交者: Alex Elder

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NLachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 87bef181
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册