X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fll_dirstripe_verify.c;h=09cf1b900488f272d2520cdd7449f24374f48607;hb=471c7966eb03e6283561ba5690a6f9adab68bb9e;hp=24d584b11f4d4c6774d3741218b456c554cf7b07;hpb=6712478e79588e73e28c7ccac3afc7ac2368a4f3;p=fs%2Flustre-release.git diff --git a/lustre/tests/ll_dirstripe_verify.c b/lustre/tests/ll_dirstripe_verify.c index 24d584b..09cf1b9 100644 --- a/lustre/tests/ll_dirstripe_verify.c +++ b/lustre/tests/ll_dirstripe_verify.c @@ -23,7 +23,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2014, Intel Corporation. + * Copyright (c) 2011, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -279,7 +279,7 @@ int main(int argc, char **argv) rc = llapi_file_get_stripe(argv[1], lum_dir); if (rc == -ENODATA) { - char root[PATH_MAX]; + char root[PATH_MAX], path[PATH_MAX + 2]; rc = llapi_search_mounts(argv[1], 0, root, NULL); if (rc) { @@ -288,14 +288,14 @@ int main(int argc, char **argv) goto cleanup; } - strlcat(root, "/.", PATH_MAX); - rc = llapi_file_get_stripe(root, lum_dir); + snprintf(path, sizeof(path), "%s/.", root); + rc = llapi_file_get_stripe(path, lum_dir); if (rc == -ENODATA) { free(lum_dir); lum_dir = NULL; } else if (rc) { llapi_error(LLAPI_MSG_ERROR, rc, "error: cant't get " - "root's LOVEA for %s\n", root); + "root's LOVEA for %s\n", path); goto cleanup; } } else if (rc) {