pv 955274 - Limit the random generated file size attribute to 1 TB (if size is too...
authorVlad Apostolov <vapo@sgi.com>
Wed, 27 Sep 2006 06:07:10 +0000 (06:07 +0000)
committerVlad Apostolov <vapo@sgi.com>
Wed, 27 Sep 2006 06:07:10 +0000 (06:07 +0000)
Merge of master-melb:xfs-cmds:27060a by kenmcd.

  pv 955274 - Limit the random generated file size attribute to 1 TB (if size is too big the kernel panics)

dmapi/src/suite2/src/test_fileattr.c

index b0528eec8d30550c342affc64cdc94fcebc9947f..538f371d9106588a20227f97309324f18b728e44 100644 (file)
@@ -237,7 +237,7 @@ main(
          stat_arr[i].dt_uid=(uid_t)(rand()+rand()*0x10000);
          stat_arr[i].dt_gid=(gid_t)(rand()+rand()*0x10000);
          stat_arr[i].dt_mode=(mode_t)((rand()%4096)+32768);
-         stat_arr[i].dt_size=(dm_off_t)(rand()+rand()*0x10000);
+          stat_arr[i].dt_size=((dm_off_t)(rand()+rand()*0x10000)) & 0x3FFFFFFFFFFFF; /* 1 TB max */
        }       
 
        /*-----------------------------------------------------*\