Whamcloud - gitweb
b=22385 Computing result of unsigned variable may < 0.
authoryangsheng <Sheng.Yang@sun.com>
Mon, 9 Aug 2010 06:27:38 +0000 (10:27 +0400)
committerMikhail Pershin <tappro@sun.com>
Fri, 13 Aug 2010 06:24:12 +0000 (10:24 +0400)
i=johann
i=wangdi

lustre/llite/rw.c

index 7d5adcd..893c66e 100644 (file)
@@ -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,