From owner-svn-src-all@freebsd.org Sun Nov 3 23:31:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68FC61AB927; Sun, 3 Nov 2019 23:31:00 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475sch2Cmdz3CSp; Sun, 3 Nov 2019 23:31:00 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [IPv6:2601:641:300:6e9f:7139:e5f8:3da1:d5af]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 6C67D16D25; Sun, 3 Nov 2019 23:30:59 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1e.0.191013 Date: Sun, 03 Nov 2019 15:30:55 -0800 Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs From: Ravi Pokala To: Toomas Soome , , , Message-ID: Thread-Topic: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs References: <201911031325.xA3DPl3B080386@repo.freebsd.org> In-Reply-To: <201911031325.xA3DPl3B080386@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 23:31:00 -0000 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: on behalf of Toomas Soome Date: 2019-11-03, Sunday at 05:25 To: , , 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