From nobody Wed Sep 29 20:15:42 2021 X-Original-To: geom@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9DBB917E2A43 for ; Wed, 29 Sep 2021 20:15:45 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKSL949z3z4pW5; Wed, 29 Sep 2021 20:15:45 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from [192.168.0.88] (unknown [195.64.148.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id DB6752CE60; Wed, 29 Sep 2021 20:15:44 +0000 (UTC) (envelope-from avg@freebsd.org) From: Andriy Gapon To: Xin LI Cc: Warner Losh , "freebsd-geom@FreeBSD.org" , "Conrad E. Meyer" References: <263983af-166b-f1c3-9e9a-c988727c1754@FreeBSD.org> Subject: Re: geom labels as aliases Message-ID: <183ab48b-bb57-5ce7-c5be-84f663f9b3de@FreeBSD.org> Date: Wed, 29 Sep 2021 23:15:42 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 List-Id: GEOM-specific discussions and implementations List-Archive: https://lists.freebsd.org/archives/freebsd-geom List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-geom@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 29/09/2021 20:28, Xin LI wrote: > For context, the discussion was at > https://lists.freebsd.org/pipermail/freebsd-current/2020-June/thread.html#76210 . My takeaway[*], perhaps incorrect, from reading that is that the problem is with this check in g_label_taste(): /* Skip providers that are already open for writing. */ if (pp->acw > 0) return (NULL); On the one hand this looks reasonable, on the other hand if a disk is open for writing it does not mean that its can change (it cannot). If a partition is open for writing it does not mean that its label can change (it cannot unless its container is open for writing as well). It does not necessarily mean that a filesystem label will change (although it can). We probably need a better mechanism to communicate label changes than the access bits alone. As a quick solution, perhaps we could add a flag that allows a label class to declare that it can safely test a provider even when it's open for writing? [*] I made my conclusion based on this snippet: > ZFS gets an exclusive hold of 'ada1p2' despite the pool is carefully created > to use /dev/diskid/p2 instead of ada1p2. ... > However, this will prevent GEOM from properly creating > /dev/diskid/. -- Andriy Gapon