Whamcloud - gitweb
LU-7813 utils: improve lfs setstripe pool error message
[fs/lustre-release.git] / lustre / utils / lfs.c
index 14a84a9..60bdab6 100644 (file)
@@ -364,19 +364,19 @@ command_t cmdlist[] = {
         "migrate a directory between MDTs.\n"
         "usage: migrate --mdt-index <mdt_idx> [--verbose|-v] "
         "<directory>\n"
-        "\tmdt_idx:      index of the destination MDT\n"},
-       {"migrate", lfs_setstripe, 0,
+        "\tmdt_idx:      index of the destination MDT\n"
+        "\n"
         "migrate file objects from one OST "
         "layout\nto another (may be not safe with concurent writes).\n"
-        "usage: migrate "
+        "usage: migrate  "
         "[--stripe-count|-c] <stripe_count>\n"
-        "[--stripe-index|-i] <start_ost_index>\n"
-        "[--stripe-size|-S] <stripe_size>\n"
-        "[--pool|-p] <pool_name>\n"
-        "[--ost-list|-o] <ost_indices>\n"
-        "[--block|-b]\n"
-        "[--non-block|-n]\n"
-        "<file|directory>\n"
+        "              [--stripe-index|-i] <start_ost_index>\n"
+        "              [--stripe-size|-S] <stripe_size>\n"
+        "              [--pool|-p] <pool_name>\n"
+        "              [--ost-list|-o] <ost_indices>\n"
+        "              [--block|-b]\n"
+        "              [--non-block|-n]\n"
+        "              <file|directory>\n"
         "\tstripe_count:     number of OSTs to stripe a file over\n"
         "\tstripe_ost_index: index of the first OST to stripe a file over\n"
         "\tstripe_size:      number of bytes to store before moving to the next OST\n"
@@ -1224,10 +1224,11 @@ static int lfs_setstripe(int argc, char **argv)
                        /* Save the first error encountered. */
                        if (result2 == 0)
                                result2 = result;
-                       fprintf(stderr,
-                               "error: %s: %s file '%s' failed\n",
+                       fprintf(stderr, "error: %s: %s file '%s' failed: %s\n",
                                argv[0], migrate_mode ? "migrate" : "create",
-                               fname);
+                               fname,
+                               pool_name_arg != NULL && result == EINVAL ?
+                               "OST not in pool?" : strerror(result));
                        continue;
                }
        }