X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fllapi_layout_test.c;h=3002929a52e3f622b954ee70e58b747d2f8e6747;hb=42923270537d52d2b90c59a2db16d428b4f5a90c;hp=d5258a9df8ece95895c34babcfcfa49da338bf2b;hpb=f20aa2305067504185684946195e9e1bb1a68a49;p=fs%2Flustre-release.git diff --git a/lustre/tests/llapi_layout_test.c b/lustre/tests/llapi_layout_test.c index d5258a9..3002929 100644 --- a/lustre/tests/llapi_layout_test.c +++ b/lustre/tests/llapi_layout_test.c @@ -20,6 +20,9 @@ * GPL HEADER END */ /* + * Copyright (c) 2016, 2017, Intel Corporation. + */ +/* * These tests exercise the llapi_layout API which abstracts the layout * of a Lustre file behind an opaque data type. They assume a Lustre * file system with at least 2 OSTs and a pool containing at least the @@ -200,7 +203,7 @@ void test3(void) { int rc; struct llapi_layout *layout; - lustre_fid fid; + struct lu_fid fid; char fidstr[4096]; char path[PATH_MAX]; @@ -231,7 +234,7 @@ void test4(void) uint64_t size; const char *lfs = getenv("LFS"); char mypool[LOV_MAXPOOLNAME + 1] = { '\0' }; - char cmd[4096]; + char cmd[PATH_MAX + 128]; char path[PATH_MAX]; snprintf(path, sizeof(path), "%s/%s", lustre_dir, T4FILE); @@ -1080,7 +1083,7 @@ void test26(void) uint64_t size; uint64_t pattern; char dir[PATH_MAX]; - char cmd[4096]; + char cmd[PATH_MAX + 64]; snprintf(dir, sizeof(dir), "%s/%s", lustre_dir, T26DIR); rc = rmdir(dir); @@ -1127,11 +1130,11 @@ void test27(void) uint64_t count; uint64_t size; uint64_t pattern; - char dirpath[PATH_MAX]; - char filepath[PATH_MAX]; - char cmd[4096]; + char dirpath[PATH_MAX + 128]; + char filepath[PATH_MAX * 2]; + char cmd[PATH_MAX * 2]; - snprintf(dirpath, sizeof(dirpath), "%s/%s", lustre_dir, T27DIR); + snprintf(dirpath, sizeof(dirpath) - 1, "%s/%s", lustre_dir, T27DIR); snprintf(filepath, sizeof(filepath), "%s/nonesuch", dirpath); rc = rmdir(dirpath); @@ -1176,7 +1179,7 @@ void test28(void) const char *lfs = getenv("LFS"); uint64_t count; char dirpath[PATH_MAX]; - char cmd[4096]; + char cmd[PATH_MAX + 64]; snprintf(dirpath, sizeof(dirpath), "%s/%s", lustre_dir, T28DIR);