From: yangsheng Date: Mon, 9 Aug 2010 06:27:38 +0000 (+0400) Subject: b=22385 Computing result of unsigned variable may < 0. X-Git-Tag: 2.0.50.0~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3e8e3d644e0439c45da62b1e2a1ccd13946e5513 b=22385 Computing result of unsigned variable may < 0. i=johann i=wangdi --- diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7d5adcd..893c66e 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -638,7 +638,8 @@ static int ras_inside_ra_window(unsigned long idx, struct ra_io_arg *ria) * For stride I/O mode, just check whether the idx is inside * the ria_pages. */ return ria->ria_length == 0 || ria->ria_length == ria->ria_pages || - (idx - ria->ria_stoff) % ria->ria_length < ria->ria_pages; + (idx >= ria->ria_stoff && (idx - ria->ria_stoff) % + ria->ria_length < ria->ria_pages); } static int ll_read_ahead_pages(const struct lu_env *env,