From ae03fc8a48dbd2f93b8bf1dfecae10c615d5b949 Mon Sep 17 00:00:00 2001 From: Minh Diep Date: Tue, 7 Feb 2012 09:12:58 -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: Ic4ee84a45bdb5dc934a3e681a4fc2fcd51f14b99 Reviewed-on: http://review.whamcloud.com/2112 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Cliff White Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- 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 8625d4b..972e3a2 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; + *size = strtoull(optarg, &end, 0); if (*end != '\0') { @@ -1633,7 +1636,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