Skip to content

Commit

Permalink
Remove the slog restriction on bootfs pools
Browse files Browse the repository at this point in the history
Under Linux this restriction does not apply because we have access
to all the required devices.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#1631
  • Loading branch information
behlendorf authored and unya committed Dec 13, 2013
1 parent a99c5ba commit 96e2978
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
7 changes: 0 additions & 7 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,13 +1409,6 @@ zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
(void) zfs_error(hdl, EZFS_BADVERSION, msg);
break;

case EDOM:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"root pool can not have multiple vdevs"
" or separate logs"));
(void) zfs_error(hdl, EZFS_POOL_NOTSUP, msg);
break;

case ENOTBLK:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"cache device must be a disk or disk slice"));
Expand Down
25 changes: 1 addition & 24 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,37 +1751,14 @@ zfs_ioc_vdev_add(zfs_cmd_t *zc)
{
spa_t *spa;
int error;
nvlist_t *config, **l2cache, **spares;
uint_t nl2cache = 0, nspares = 0;
nvlist_t *config;

error = spa_open(zc->zc_name, &spa, FTAG);
if (error != 0)
return (error);

error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size,
zc->zc_iflags, &config);
(void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_L2CACHE,
&l2cache, &nl2cache);

(void) nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_SPARES,
&spares, &nspares);

/*
* A root pool with concatenated devices is not supported.
* Thus, can not add a device to a root pool.
*
* Intent log device can not be added to a rootpool because
* during mountroot, zil is replayed, a seperated log device
* can not be accessed during the mountroot time.
*
* l2cache and spare devices are ok to be added to a rootpool.
*/
if (spa_bootfs(spa) != 0 && nl2cache == 0 && nspares == 0) {
nvlist_free(config);
spa_close(spa, FTAG);
return (SET_ERROR(EDOM));
}

if (error == 0) {
error = spa_vdev_add(spa, config);
nvlist_free(config);
Expand Down

0 comments on commit 96e2978

Please sign in to comment.