xfs: fix quotacheck dquot id overflow infinite loop

If a dquot has an id of U32_MAX, the next lookup index increment
overflows the uint32_t back to 0. This starts the lookup sequence
over from the beginning, repeats indefinitely and results in a
livelock.

Update xfs_qm_dquot_walk() to explicitly check for the lookup
overflow and exit the loop.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by Brian Foster and committed by Darrick J. Wong cfaf2d03 10479e2d

Changed files
+3
fs
xfs
+3
fs/xfs/xfs_qm.c
··· 111 111 skipped = 0; 112 112 break; 113 113 } 114 + /* we're done if id overflows back to zero */ 115 + if (!next_index) 116 + break; 114 117 } 115 118 116 119 if (skipped) {