From c42ad03831f4c564c8125f42a18ae7d700d6a3f5 Mon Sep 17 00:00:00 2001 From: Minh Diep Date: Thu, 5 Jan 2012 17:40:57 -0800 Subject: [PATCH] LU-960 utils: bad stripe count report, and validate stripe size Need to use %d to print -1 instead of %u Need to check for -1 in input for stripe size Signed-off-by: Minh Diep Change-Id: Ia9593497764f1d3c0110ad22d70b5da8f7b07a21 Reviewed-on: http://review.whamcloud.com/1922 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Richard Henwood --- lustre/utils/liblustreapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 386bbd6..2994cdd 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -177,6 +177,9 @@ int parse_size(char *optarg, unsigned long long *size, { char *end; + if (strncmp(optarg, "-", 1) == 0) + return -1; + if (*size_units == 0) *size_units = 1; @@ -1654,7 +1657,7 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path, &scount, NULL, NULL); if (rc == 0) - llapi_printf(LLAPI_MSG_NORMAL, "%u%c", + llapi_printf(LLAPI_MSG_NORMAL, "%d%c", scount, nl); else llapi_error(LLAPI_MSG_ERROR, rc, -- 1.8.3.1