Whamcloud - gitweb
b=22385 Computing result of unsigned variable may < 0.
authoryangsheng <Sheng.Yang@Sun.COM>
Tue, 6 Apr 2010 15:37:21 +0000 (23:37 +0800)
committerJohann Lombardi <johann@sun.com>
Tue, 6 Apr 2010 17:33:10 +0000 (19:33 +0200)
i=johann
i=wangdi

lustre/llite/rw.c

index 8c49a03..f42419e 100644 (file)
@@ -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,