Print this page
3745 zpool create should treat -O mountpoint and -m the same
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_pool.c
          +++ new/usr/src/lib/libzfs/common/libzfs_pool.c
↓ open down ↓ 1171 lines elided ↑ open up ↑
1172 1172                  case ENOTBLK:
1173 1173                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1174 1174                              "cache device must be a disk or disk slice"));
1175 1175                          return (zfs_error(hdl, EZFS_BADDEV, msg));
1176 1176  
1177 1177                  default:
1178 1178                          return (zpool_standard_error(hdl, errno, msg));
1179 1179                  }
1180 1180          }
1181 1181  
1182      -        /*
1183      -         * If this is an alternate root pool, then we automatically set the
1184      -         * mountpoint of the root dataset to be '/'.
1185      -         */
1186      -        if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT),
1187      -            &altroot) == 0) {
1188      -                zfs_handle_t *zhp;
1189      -
1190      -                verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL);
1191      -                verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT),
1192      -                    "/") == 0);
1193      -
1194      -                zfs_close(zhp);
1195      -        }
1196      -
1197 1182  create_failed:
1198 1183          zcmd_free_nvlists(&zc);
1199 1184          nvlist_free(zc_props);
1200 1185          nvlist_free(zc_fsprops);
1201 1186          return (ret);
1202 1187  }
1203 1188  
1204 1189  /*
1205 1190   * Destroy the given pool.  It is up to the caller to ensure that there are no
1206 1191   * datasets left in the pool.
↓ open down ↓ 2872 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX