Whamcloud - gitweb
LU-960 utils: bad stripe count report, and validate stripe size
authorMinh Diep <mdiep@whamcloud.com>
Tue, 7 Feb 2012 17:12:58 +0000 (09:12 -0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 24 Mar 2012 17:19:00 +0000 (13:19 -0400)
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 <mdiep@whamcloud.com>
Change-Id: Ic4ee84a45bdb5dc934a3e681a4fc2fcd51f14b99
Reviewed-on: http://review.whamcloud.com/2112
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Cliff White <cliffw@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/liblustreapi.c

index 8625d4b..972e3a2 100644 (file)
@@ -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,