X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fmultiop.c;h=e906af67d9520f8a43fa83568ee245c8091fc513;hp=1152dc0df4c0bdff434d9eec15115e251e990283;hb=8faf82a6b002ecab7eaf4c6a0ccfaa72ecdd0154;hpb=b23da8fcae05b8c8a0ba679fed1ebe718d93ebb7;ds=inline diff --git a/lustre/tests/multiop.c b/lustre/tests/multiop.c index 1152dc0..e906af6 100755 --- a/lustre/tests/multiop.c +++ b/lustre/tests/multiop.c @@ -187,6 +187,7 @@ int main(int argc, char **argv) exit(1); } + memset(&st, 0, sizeof(st)); signal(SIGUSR1, usr1_handler); fname = argv[1]; @@ -265,6 +266,11 @@ int main(int argc, char **argv) } break; case 'M': + if (st.st_size == 0) { + fprintf(stderr, "mmap without preceeding stat, or on" + " zero length file.\n"); + exit(-1); + } mmap_len = st.st_size; mmap_ptr = mmap(NULL, mmap_len, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);