svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs

Ravi Pokala rpokala at freebsd.org
Sun Nov 3 23:31:00 UTC 2019


Uh....

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

    [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@)

-----Original Message-----
From: <owner-src-committers at freebsd.org> on behalf of Toomas Soome <tsoome at FreeBSD.org>
Date: 2019-11-03, Sunday at 05:25
To: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at 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
    
    Log:
      loader: we do not support booting from pool with log device
      
      If pool has log device, stop there and tell about it.
    
    Modified:
      head/stand/libsa/zfs/zfs.c
      head/stand/libsa/zfs/zfsimpl.c
      head/sys/cddl/boot/zfs/zfsimpl.h
    
    Modified: head/stand/libsa/zfs/zfs.c
    ==============================================================================
    --- 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 = 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 = malloc(sizeof(*mount));
     	if (mount == NULL)
     		return (ENOMEM);
    
    Modified: head/stand/libsa/zfs/zfsimpl.c
    ==============================================================================
    --- 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_present;
    +	uint64_t is_log;
     
     	if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64,
     	    NULL, &guid)
    @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
     	}
     
     	is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0;
    +	is_log = 0;
     
     	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);
     
     	vdev = vdev_find(guid);
     	if (!vdev) {
    @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde
     				return (ENOMEM);
     			vdev->v_name = name;
     		}
    +		vdev->v_islog = is_log == 1;
     	} else {
     		is_new = 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 = print_state(indent, vdev->v_name, vdev->v_state);
     	if (ret != 0)
     		return (ret);
    @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, 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 = vdev->v_islog;
     
     	/*
     	 * Re-evaluate top-level vdev state.
    
    Modified: head/sys/cddl/boot/zfs/zfsimpl.h
    ==============================================================================
    --- 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;
     
     /* IO related arguments. */
    




More information about the svn-src-head mailing list