Whamcloud - gitweb
b=20575
authorpanda <panda>
Mon, 5 Oct 2009 15:39:55 +0000 (15:39 +0000)
committerpanda <panda>
Mon, 5 Oct 2009 15:39:55 +0000 (15:39 +0000)
o=Tom Wang
i=Johann Lombardi
i=Andrew Perepechko

avoid overflow in ll_readahead

lustre/llite/rw.c

index 663deca..5bf009c 100644 (file)
@@ -1733,8 +1733,8 @@ static int ll_readahead(struct ll_readahead_state *ras,
         /* Enlarge the RA window to encompass the full read */
         if (bead != NULL && ras->ras_window_start + ras->ras_window_len <
             bead->lrr_start + bead->lrr_count) {
-                obd_off read_end = (bead->lrr_start + bead->lrr_count) <<
-                                    CFS_PAGE_SHIFT;
+                obd_off read_end = ((obd_off)(bead->lrr_start +
+                                              bead->lrr_count))<<CFS_PAGE_SHIFT;
                 obd_extent_calc(exp, lsm, OBD_CALC_STRIPE_RPC_END_ALIGN,
                                 &read_end);
                 ras->ras_window_len = ((read_end + 1) >> CFS_PAGE_SHIFT) -