提交 7a19dee1 编写于 作者: J Jan Kara 提交者: Dave Chinner

xfs: Check error during inode btree iteration in xfs_bulkstat()

xfs_bulkstat() doesn't check error return from xfs_btree_increment(). In
case of specific fs corruption that could result in xfs_bulkstat()
entering an infinite loop because we would be looping over the same
chunk over and over again. Fix the problem by checking the return value
and terminating the loop properly.

Coverity-id: 1231338
cc: <stable@vger.kernel.org>
Signed-off-by: NJan Kara <jack@suse.cz>
Reviewed-by: NJie Liu <jeff.u.liu@gmail.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 a6bbce54
......@@ -474,6 +474,10 @@ xfs_bulkstat(
*/
agino = r.ir_startino + XFS_INODES_PER_CHUNK;
error = xfs_btree_increment(cur, 0, &tmp);
if (error) {
end_of_ag = 1;
goto del_cursor;
}
cond_resched();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册