]> granicus.if.org Git - zfs/commitdiff
Improve differing sector size error
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Jun 2014 23:36:13 +0000 (16:36 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 27 Jun 2014 18:44:36 +0000 (11:44 -0700)
When adding or replacing a vdev with a different sector size the
error message should be more useful.  In addition to describing
the problem provide a hint that the '-o ashift' option can be
used to override the optimal default value.

Since using a non-optimal value may incur a significant performance
penalty we should issue this error.  But there a numerous reasons
why a administrator may wish to do this anyway.

Signed-off-by: Niklas Edmundsson <ZNikke@github>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2421

lib/libzfs/libzfs_pool.c

index b1ddd983d89590be062d4e2df097a3248cecc1c8..9d03667115b364bb8aa9e130452aaae8fbc48ace 100644 (file)
@@ -2753,10 +2753,11 @@ zpool_vdev_attach(zpool_handle_t *zhp,
 
        case EDOM:
                /*
-                * The new device has a different alignment requirement.
+                * The new device has a different optimal sector size.
                 */
                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "devices have different sector alignment"));
+                   "new device has a different optimal sector size; use the "
+                   "option '-o ashift=N' to override the optimal size"));
                (void) zfs_error(hdl, EZFS_BADDEV, msg);
                break;