-x shouldn't warn about old on-disk format or unavailable features
[zfs.git] / cmd / zpool / zpool_main.c
index 8da4620..3200698 100644 (file)
@@ -3725,7 +3725,7 @@ print_scan_status(pool_scan_stat_t *ps)
        double fraction_done;
        char processed_buf[7], examined_buf[7], total_buf[7], rate_buf[7];
 
-       (void) printf(gettext(" scan: "));
+       (void) printf(gettext("  scan: "));
 
        /* If there's never been a scan, there's not much to say. */
        if (ps == NULL || ps->pss_func == POOL_SCAN_NONE ||
@@ -3913,10 +3913,16 @@ print_dedup_stats(nvlist_t *config)
         * table continue processing the stats.
         */
        if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,
-           (uint64_t **)&ddo, &c) != 0 || ddo->ddo_count == 0)
+           (uint64_t **)&ddo, &c) != 0)
                return;
 
        (void) printf("\n");
+       (void) printf(gettext(" dedup: "));
+       if (ddo->ddo_count == 0) {
+               (void) printf(gettext("no DDT entries\n"));
+               return;
+       }
+
        (void) printf("DDT entries %llu, size %llu on disk, %llu in core\n",
            (u_longlong_t)ddo->ddo_count,
            (u_longlong_t)ddo->ddo_dspace,
@@ -3964,7 +3970,10 @@ status_callback(zpool_handle_t *zhp, void *data)
         * If we were given 'zpool status -x', only report those pools with
         * problems.
         */
-       if (reason == ZPOOL_STATUS_OK && cbp->cb_explain) {
+       if (cbp->cb_explain &&
+           (reason == ZPOOL_STATUS_OK ||
+           reason == ZPOOL_STATUS_VERSION_OLDER ||
+           reason == ZPOOL_STATUS_FEAT_DISABLED)) {
                if (!cbp->cb_allpools) {
                        (void) printf(gettext("pool '%s' is healthy\n"),
                            zpool_get_name(zhp));
@@ -4084,8 +4093,8 @@ status_callback(zpool_handle_t *zhp, void *data)
                    "but some features are unavailable.\n"));
                (void) printf(gettext("action: Upgrade the pool using 'zpool "
                    "upgrade'.  Once this is done, the\n\tpool will no longer "
-                   "be accessible on software that does not support feature\n"
-                   "\tflags.\n"));
+                   "be accessible on software that does not support\n\t"
+                   "feature flags.\n"));
                break;
 
        case ZPOOL_STATUS_VERSION_NEWER: