From: Alexander Zarochentsev Date: Sun, 15 Jul 2018 21:17:20 +0000 (+0300) Subject: LU-11881 utils: silence error message X-Git-Tag: 2.12.52~82 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=363e287ac9e8d07287d117ae4e85afb1015deca0 LU-11881 utils: silence error message llapi_get_poollist prints an error message in case of reallocating the buffer and successful completion. Cray-bug-id: LUS-6185 Test-Parameters: testlist=ost-pools Change-Id: I0ca1f25edf3f4c89525d41f2deab8d25ec9e0516 Signed-off-by: Alexander Zarochentsev Reviewed-on: https://review.whamcloud.com/34086 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Alexandr Boyko Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 78dc8a5..bb1bf98 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1520,7 +1520,6 @@ int llapi_get_poollist(const char *name, char **poollist, int list_size, goto free_path; } - llapi_printf(LLAPI_MSG_NORMAL, "Pools from %s:\n", fsname); dir = opendir(pathname.gl_pathv[0]); if (dir == NULL) { rc = -errno; @@ -1545,14 +1544,14 @@ int llapi_get_poollist(const char *name, char **poollist, int list_size, /* check output bounds */ if (nb_entries >= list_size) { rc = -EOVERFLOW; - goto free_dir; + goto free_dir_no_msg; } /* +2 for '.' and final '\0' */ if (used + strlen(pool->d_name) + strlen(fsname) + 2 > buffer_size) { rc = -EOVERFLOW; - goto free_dir; + goto free_dir_no_msg; } sprintf(buffer + used, "%s.%s", fsname, pool->d_name); @@ -1565,6 +1564,10 @@ free_dir: if (rc) llapi_error(LLAPI_MSG_ERROR, rc, "Error reading pool list for '%s'", name); + else + llapi_printf(LLAPI_MSG_NORMAL, "Pools from %s:\n", fsname); + +free_dir_no_msg: closedir(dir); free_path: cfs_free_param_data(&pathname);