From owner-freebsd-bugs@freebsd.org Fri Feb 12 21:15:17 2021 Return-Path: Delivered-To: freebsd-bugs@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 EF3FE531BAB for ; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DcmVY6Gb6z4RZ1 for ; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id D721853195F; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) Delivered-To: bugs@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 D6E35531B44 for ; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcmVY5gHcz4Rm9 for ; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B59692C23 for ; Fri, 12 Feb 2021 21:15:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 11CLFH9E015987 for ; Fri, 12 Feb 2021 21:15:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 11CLFHgt015986 for bugs@FreeBSD.org; Fri, 12 Feb 2021 21:15:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253471] Change 348906: vdev_geom_attach_by_guids() breaks other use cases Date: Fri, 12 Feb 2021 21:15:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: daveb@spectralogic.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 21:15:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253471 Bug ID: 253471 Summary: Change 348906: vdev_geom_attach_by_guids() breaks other use cases Product: Base System Version: 12.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: daveb@spectralogic.com Change MFC r344316, SVN Importer: FreeBSD/base rev 348906 breaks the following scenario: - Assume 3 blank, all ZFS label cleared, disks in the system. - Shutdown, remove one of the blanks, put in on the shelf, reboot. - Create a mirror pool on the 2 remaining disk, shutdown. - Replace one of the mirror disks with the with the previously removed blank, put the zfs mirror member on the shelf, reboot. All these machinations are required to ensure the blank disk enumerates the same as the mirror disk member (has the same vdev_path). zpool status will now report the pool as a healthy "ONLINE" with a missing disk: # zpool status -x pool: pool200 state: ONLINE status: One or more devices could not be used because the label is missing = or invalid. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Replace the device using 'zpool replace'. see: http://illumos.org/msg/ZFS-8000-4J scan: none requested config: NAME STATE READ WRITE CKSUM pool200 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 1165392866195823403 UNAVAIL 0 0 0 was /dev/da8 da9 ONLINE 0 0 0 This is because change 348906 allows vdev_geom_attach_by_guids() to attach a vdev that has a "NO_MATCH" guid but satisfies the requested vdev_path: } else if (match =3D=3D best_match) { /* match =3D NO_MATCH and best_match is initialized to NO_MATCH; * if the paths match we will attach it. */ if (strcmp(pp->name, vdpath) =3D=3D 0) { best_pp =3D pp; } } >From ZFS_LOG() via vdev_geom_open_by_guids() and others: vdev_geom_attach:240[1]: Attaching to da8. vdev_geom_attach:309[1]: Created consumer for da8. vdev_geom_open_by_guids:797[1]: Attach by guid [17284178551510092527:1165392866195823403] succeeded, provider da8. Later back in vdev_validate(), this condition never gets vdev_propagate()ed when detected because for this one error, vdev_set_state() is called with "is_open" true: if ((label =3D vdev_label_read_config(vd, txg)) =3D=3D NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); return (0); } It is curious to me that for this one error path vdev_validate() calls vdev_set_state(..., B_TRUE, ...) whereas all other are B_FALSE. For my purposes, reverting 348906 fixes the issue, but changing=20 vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); to vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); also solves the problem. --=20 You are receiving this mail because: You are the assignee for the bug.=