<div dir="ltr">Looks good to me. Reviewed-by: Jie Liu <<a href="mailto:jeff.u.liu@gmail.com">jeff.u.liu@gmail.com</a>><div><br></div><div><br></div><div>Cheers,</div><div>-Jeff</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 21, 2014 at 10:31 PM, Jan Kara <span dir="ltr"><<a href="mailto:jack@suse.cz" target="_blank">jack@suse.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">xfs_bulkstat() doesn't check error return from xfs_btree_increment(). In<br>
case of specific fs corruption that could result in xfs_bulkstat()<br>
entering an infinite loop because we would be looping over the same<br>
chunk over and over again. Fix the problem by checking the return value<br>
and terminating the loop properly.<br>
<br>
Coverity-id: 1231338<br>
Signed-off-by: Jan Kara <<a href="mailto:jack@suse.cz">jack@suse.cz</a>><br>
---<br>
fs/xfs/xfs_itable.c | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c<br>
index f1deb961a296..66d5c619517d 100644<br>
--- a/fs/xfs/xfs_itable.c<br>
+++ b/fs/xfs/xfs_itable.c<br>
@@ -474,6 +474,10 @@ xfs_bulkstat(<br>
*/<br>
agino = r.ir_startino + XFS_INODES_PER_CHUNK;<br>
error = xfs_btree_increment(cur, 0, &tmp);<br>
+ if (error) {<br>
+ end_of_ag = 1;<br>
+ break;<br>
+ }<br>
cond_resched();<br>
}<br>
/*<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.4<br>
<br>
_______________________________________________<br>
xfs mailing list<br>
<a href="mailto:xfs@oss.sgi.com">xfs@oss.sgi.com</a><br>
<a href="http://oss.sgi.com/mailman/listinfo/xfs" target="_blank">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
</font></span></blockquote></div><br></div>