From 536e1116989e865b7e53a8d4a9b93dec3ae5b6ca Mon Sep 17 00:00:00 2001 From: yangsheng Date: Tue, 6 Apr 2010 23:37:21 +0800 Subject: [PATCH] b=22385 Computing result of unsigned variable may < 0. i=johann i=wangdi --- lustre/llite/rw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 8c49a03..f42419e 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -1629,7 +1629,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(struct obd_export *exp, -- 1.8.3.1