提交 4e5ae838 编写于 作者: D David Chinner 提交者: Tim Shimmin

[XFS] xfs_bmapi fails to update the previous extent pointer

When processing multiple extent maps, xfs_bmapi needs to keep track of the
extent behind the one it is currently working on to be able to trim extent
ranges correctly. Failing to update the previous pointer can result in
corrupted extent lists in memory and this will result in panics or assert
failures.

Update the previous pointer correctly when we move to the next extent to
process.

SGI-PV: 965631
SGI-Modid: xfs-linux-melb:xfs-kern:28773a
Signed-off-by: NDavid Chinner <dgc@sgi.com>
Signed-off-by: NVlad Apostolov <vapo@sgi.com>
Signed-off-by: NTim Shimmin <tes@sgi.com>
上级 210c6f1c
......@@ -5219,10 +5219,10 @@ xfs_bmapi(
* Else go on to the next record.
*/
ep = xfs_iext_get_ext(ifp, ++lastx);
if (lastx >= nextents) {
prev = got;
if (lastx >= nextents)
eof = 1;
prev = got;
} else
else
xfs_bmbt_get_all(ep, &got);
}
ifp->if_lastex = lastx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册