Fix XFSQA test 144
authorDonald Douwsma <donaldd@sgi.com>
Wed, 18 Jun 2008 16:08:20 +0000 (16:08 +0000)
committerDonald Douwsma <donaldd@sgi.com>
Wed, 18 Jun 2008 16:08:20 +0000 (16:08 +0000)
Two really dumb bugs:

 - "foo & 0x3FFFFFFFFFFFF" doesn't cap at 1TB, but rather at more than
   two magnitudes larger than that.  That gets us EFBIG with typical
   32bit XFS setups.
 - the command array can easily overflow and thus let the test fail

Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge of master-melb:xfs-cmds:31327a by kenmcd.

  Fix XFSQA test 144

dmapi/src/suite2/src/test_fileattr.c

index 446c38066c2a3839704e9f4fbb3f185e872ad2ba..520fc8de2a1780fa94cce809e07a8d76c58b91d0 100644 (file)
@@ -160,7 +160,7 @@ main(
        char            *ls_path;
        char            *pathname;
        char            test_file[100];
-       char            command[100];
+       char            command[200];
        int             num_files=50;
        dm_stat_t       *stat_arr;
        dm_stat_t       dmstat;
@@ -244,7 +244,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)) & 0x3FFFFFFFFFFFF; /* 1 TB max */
+          stat_arr[i].dt_size=((dm_off_t)(rand()+rand()*0x10000)) & 0x1FFFFFFFFFFULL; /* 1 TB max */
        }       
 
        /*-----------------------------------------------------*\