Whamcloud - gitweb
LU-960 utils: bad stripe count report, and validate stripe size
authorMinh Diep <mdiep@whamcloud.com>
Fri, 6 Jan 2012 01:40:57 +0000 (17:40 -0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jan 2012 18:16:22 +0000 (13:16 -0500)
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: Ia9593497764f1d3c0110ad22d70b5da8f7b07a21
Reviewed-on: http://review.whamcloud.com/1922
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Richard Henwood <rhenwood@whamcloud.com>
lustre/utils/liblustreapi.c

index 386bbd6..2994cdd 100644 (file)
@@ -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,