Date: Wed, 29 Sep 2021 23:15:42 +0300 From: Andriy Gapon <avg@freebsd.org> To: Xin LI <delphij@gmail.com> Cc: Warner Losh <imp@bsdimp.com>, "freebsd-geom@FreeBSD.org" <geom@freebsd.org>, "Conrad E. Meyer" <cem@FreeBSD.org> Subject: Re: geom labels as aliases Message-ID: <183ab48b-bb57-5ce7-c5be-84f663f9b3de@FreeBSD.org> In-Reply-To: <CAGMYy3vzzx_W_fz=p0ifCF4JV6sTdhDcV%2Bxbi9K913S50dVC%2Bg@mail.gmail.com> References: <263983af-166b-f1c3-9e9a-c988727c1754@FreeBSD.org> <CANCZdfpg3Jt2b8dP3j%2BtX0cty8ey%2BnWBV2-rndnTz%2B=4OYW=aw@mail.gmail.com> <e1825934-85f1-7b46-bb6b-acc05b8287f1@FreeBSD.org> <CAGMYy3vzzx_W_fz=p0ifCF4JV6sTdhDcV%2Bxbi9K913S50dVC%2Bg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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/<DISKSERIAL>p2 instead of ada1p2. ... > However, this will prevent GEOM from properly creating > /dev/diskid/<DISKSERIAL>. -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?183ab48b-bb57-5ce7-c5be-84f663f9b3de>