Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Nov 2019 15:30:55 -0800
From:      Ravi Pokala <rpokala@freebsd.org>
To:        Toomas Soome <tsoome@FreeBSD.org>, <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs
Message-ID:  <AC86E653-444A-4EBD-8379-BBA53BD160D3@panasas.com>
In-Reply-To: <201911031325.xA3DPl3B080386@repo.freebsd.org>
References:  <201911031325.xA3DPl3B080386@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Uh....

I've had a log device in my boot-pool for months, and have booted without i=
ssue:

    [threepio:~] rpokala% zpool status zroot
      pool: zroot
     state: ONLINE
      scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28=
 03:10:59 2019
    config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          nvd1p4    ONLINE       0     0     0
        logs
          nvd0p1    ONLINE       0     0     0

    errors: No known data errors

-Ravi (rpokala@)

=EF=BB=BF-----Original Message-----
From: <owner-src-committers@freebsd.org> on behalf of Toomas Soome <tsoome@=
FreeBSD.org>
Date: 2019-11-03, Sunday at 05:25
To: <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@=
freebsd.org>
Subject: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

    Author: tsoome
    Date: Sun Nov  3 13:25:47 2019
    New Revision: 354283
    URL: https://svnweb.freebsd.org/changeset/base/354283
   =20
    Log:
      loader: we do not support booting from pool with log device
     =20
      If pool has log device, stop there and tell about it.
   =20
    Modified:
      head/stand/libsa/zfs/zfs.c
      head/stand/libsa/zfs/zfsimpl.c
      head/sys/cddl/boot/zfs/zfsimpl.h
   =20
    Modified: head/stand/libsa/zfs/zfs.c
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
    --- head/stand/libsa/zfs/zfs.c	Sun Nov  3 13:03:47 2019	(r354282)
    +++ head/stand/libsa/zfs/zfs.c	Sun Nov  3 13:25:47 2019	(r354283)
    @@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...)
     		spa =3D spa_find_by_guid(dev->pool_guid);
     	if (!spa)
     		return (ENXIO);
    +	if (spa->spa_with_log) {
    +		printf("Reading pool %s is not supported due to log device.\n",
    +		    spa->spa_name);
    +		return (ENXIO);
    +	}
     	mount =3D malloc(sizeof(*mount));
     	if (mount =3D=3D NULL)
     		return (ENOMEM);
   =20
    Modified: head/stand/libsa/zfs/zfsimpl.c
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
    --- head/stand/libsa/zfs/zfsimpl.c	Sun Nov  3 13:03:47 2019	(r354282)
    +++ head/stand/libsa/zfs/zfsimpl.c	Sun Nov  3 13:25:47 2019	(r354283)
    @@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist=
, vde
     	const unsigned char *kids;
     	int nkids, i, is_new;
     	uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_presen=
t;
    +	uint64_t is_log;
    =20
     	if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
     	    NULL, &guid)
    @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvli=
st, vde
     	}
    =20
     	is_offline =3D is_removed =3D is_faulted =3D is_degraded =3D isnt_present =3D 0=
;
    +	is_log =3D 0;
    =20
     	nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL,
    -			&is_offline);
    +	    &is_offline);
     	nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL,
    -			&is_removed);
    +	    &is_removed);
     	nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL,
    -			&is_faulted);
    +	    &is_faulted);
     	nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL,
    -			&is_degraded);
    +	    &is_degraded);
     	nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL,
    -			&isnt_present);
    +	    &isnt_present);
    +	nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL,
    +	    &is_log);
    =20
     	vdev =3D vdev_find(guid);
     	if (!vdev) {
    @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist=
, vde
     				return (ENOMEM);
     			vdev->v_name =3D name;
     		}
    +		vdev->v_islog =3D is_log =3D=3D 1;
     	} else {
     		is_new =3D 0;
     	}
    @@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent)
     {
     	vdev_t *kid;
     	int ret;
    +
    +	if (vdev->v_islog) {
    +		(void)pager_output("        logs\n");
    +		indent++;
    +	}
    +
     	ret =3D print_state(indent, vdev->v_name, vdev->v_state);
     	if (ret !=3D 0)
     		return (ret);
    @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_p=
riv, s
     		printf("ZFS: inconsistent nvlist contents\n");
     		return (EIO);
     	}
    +
    +	/*
    +	 * We do not support reading pools with log device.
    +	 */
    +	if (vdev->v_islog)
    +		spa->spa_with_log =3D vdev->v_islog;
    =20
     	/*
     	 * Re-evaluate top-level vdev state.
   =20
    Modified: head/sys/cddl/boot/zfs/zfsimpl.h
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
    --- head/sys/cddl/boot/zfs/zfsimpl.h	Sun Nov  3 13:03:47 2019	(r354282)
    +++ head/sys/cddl/boot/zfs/zfsimpl.h	Sun Nov  3 13:25:47 2019	(r354283)
    @@ -1670,6 +1670,7 @@ typedef struct vdev {
     	vdev_phys_read_t *v_phys_read;	/* read from raw leaf vdev */
     	vdev_read_t	*v_read;	/* read from vdev */
     	void		*v_read_priv;	/* private data for read function */
    +	boolean_t	v_islog;
     	struct spa	*spa;		/* link to spa */
     	/*
     	 * Values stored in the config for an indirect or removing vdev.
    @@ -1694,6 +1695,7 @@ typedef struct spa {
     	zio_cksum_salt_t spa_cksum_salt;	/* secret salt for cksum */
     	void		*spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS];
     	int		spa_inited;	/* initialized */
    +	boolean_t	spa_with_log;	/* this pool has log */
     } spa_t;
    =20
     /* IO related arguments. */
   =20





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC86E653-444A-4EBD-8379-BBA53BD160D3>