Bug 294542 - glabel(8): GEOM label debug gives incorrect output about already existing labels
Summary: glabel(8): GEOM label debug gives incorrect output about already existing labels
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Osipov
URL: https://reviews.freebsd.org/D56400
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-15 07:56 UTC by Michael Osipov
Modified: 2026-04-22 09:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov freebsd_committer freebsd_triage 2026-04-15 07:56:03 UTC
Running a 16-CURRENT vm in bhyve I see:
> GEOM_LABEL[2]: Tasting nda0.
> GEOM_LABEL[1]: MSDOSFS: nda0: no FAT volume detected.
> GEOM_LABEL[1]: Label for provider nda0 is diskid/DISK-nvme1.
> GEOM_LABEL[2]: Tasting nda0p1.
> GEOM_LABEL[1]: Label for provider nda0p1 is gpt/efiboot0.
> GEOM_LABEL[1]: Label for provider nda0p1 is gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting nda0p2.
> GEOM_LABEL[1]: Label for provider nda0p2 is gpt/swap0.
> GEOM_LABEL[1]: Label for provider nda0p2 is gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting nda0p3.
> GEOM_LABEL[1]: Label for provider nda0p3 is gpt/zfs0.
> GEOM_LABEL[1]: Label for provider nda0p3 is gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p3: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme1.
> GEOM_LABEL[2]: Tasting gpt/efiboot0.
> GEOM_LABEL[2]: Tasting gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/swap0.
> GEOM_LABEL[2]: Tasting gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/zfs0.
> GEOM_LABEL[2]: Tasting gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme1p1.
> GEOM_LABEL[1]: Label efiboot0(gpt/efiboot0) already exists (diskid/DISK-nvme1p1).
> GEOM_LABEL[1]: Label d73082c2-8513-11f0-b9c7-589cfc02bf05(gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme1p1).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme1p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme1p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme1p2.
> GEOM_LABEL[1]: Label swap0(gpt/swap0) already exists (diskid/DISK-nvme1p2).
> GEOM_LABEL[1]: Label d735e388-8513-11f0-b9c7-589cfc02bf05(gptid/d735e388-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme1p2).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme1p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme1p3.
> GEOM_LABEL[1]: Label zfs0(gpt/zfs0) already exists (diskid/DISK-nvme1p3).
> GEOM_LABEL[1]: Label d73ccc9a-8513-11f0-b9c7-589cfc02bf05(gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme1p3).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme1p3: no FAT signature found.
> GEOM_LABEL[1]: Label diskid/DISK-nvme1 removed.
> GEOM_LABEL[1]: Label gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[2]: Tasting nda0.
> GEOM_LABEL[2]: Tasting gpt/zfs0.
> GEOM_LABEL[1]: Label gptid/d735e388-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[1]: Label gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[2]: Tasting gpt/efiboot0.

The collision does not make sense and implies that one cannot have several labels for the same entity. Booted off 15.0-RELEASE ISO and see via serial:
> GEOM_LABEL[2]: Tasting nda0.
> Trying to mount root from cd9660:/dev/iso9660/15_0_RELEASE_AMD64_BO [ro]...
> GEOM_LABEL[1]: MSDOSFS: nda0: no FAT volume detected.
> GEOM_LABEL[1]: Label for provider nda0 is diskid/DISK-nvme0.
> GEOM_LABEL[2]: Tasting nda0p1.
> GEOM_LABEL[1]: Label for provider nda0p1 is gpt/efiboot0.
> GEOM_LABEL[1]: Label for provider nda0p1 is gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting nda0p2.
> GEOM_LABEL[1]: Label for provider nda0p2 is gpt/swap0.
> GEOM_LABEL[1]: Label for provider nda0p2 is gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting nda0p3.
> GEOM_LABEL[1]: Label for provider nda0p3 is gpt/zfs0.
> GEOM_LABEL[1]: Label for provider nda0p3 is gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p3: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0.
> GEOM_LABEL[2]: Tasting cd0.
> GEOM_LABEL[1]: ISO9660 file system detected on cd0.
> GEOM_LABEL[1]: Label for provider cd0 is iso9660/15_0_RELEASE_AMD64_BO.
> GEOM_LABEL[1]: MSDOSFS: cd0: FAT12/16 volume not valid.
> GEOM_LABEL[2]: Tasting gpt/efiboot0.
> GEOM_LABEL[2]: Tasting gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/swap0.
> GEOM_LABEL[2]: Tasting gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/zfs0.
> GEOM_LABEL[2]: Tasting gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p1.
> GEOM_LABEL[1]: Label efiboot0(gpt/efiboot0) already exists (diskid/DISK-nvme0p1).
> GEOM_LABEL[1]: Label d73082c2-8513-11f0-b9c7-589cfc02bf05(gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme0p1).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p2.
> GEOM_LABEL[1]: Label swap0(gpt/swap0) already exists (diskid/DISK-nvme0p2).
> GEOM_LABEL[1]: Label d735e388-8513-11f0-b9c7-589cfc02bf05(gptid/d735e388-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme0p2).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p3.
> GEOM_LABEL[1]: Label zfs0(gpt/zfs0) already exists (diskid/DISK-nvme0p3).
> GEOM_LABEL[1]: Label d73ccc9a-8513-11f0-b9c7-589cfc02bf05(gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05) already exists (diskid/DISK-nvme0p3).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p3: no FAT signature found.
> GEOM_LABEL[2]: Tasting iso9660/15_0_RELEASE_AMD64_BO.

Same output, looking with gpart and the created devices:
> root@:~ # gpart show
> =>       40  167772087  nda0  GPT  (80G)
>          40     532480     1  efi  (260M)
>      532520       2008        - free -  (1.0M)
>      534528   16777216     2  freebsd-swap  (8.0G)
>    17311744  150458368     3  freebsd-zfs  (72G)
>   167770112       2015        - free -  (1.0M)
> 
> =>       40  167772087  diskid/DISK-nvme0  GPT  (80G)
>          40     532480                  1  efi  (260M)
>      532520       2008                     - free -  (1.0M)
>      534528   16777216                  2  freebsd-swap  (8.0G)
>    17311744  150458368                  3  freebsd-zfs  (72G)
>   167770112       2015                     - free -  (1.0M)
and
> root@:~ # ls -l /dev/gpt*/* /dev/diskid/*
> crw-r-----  1 root operator 0x76 Apr 15 07:38 /dev/diskid/DISK-nvme0
> crw-r-----  1 root operator 0x7e Apr 15 07:38 /dev/diskid/DISK-nvme0p1
> crw-r-----  1 root operator 0x7f Apr 15 07:38 /dev/diskid/DISK-nvme0p2
> crw-r-----  1 root operator 0x80 Apr 15 07:38 /dev/diskid/DISK-nvme0p3
> crw-r-----  1 root operator 0x78 Apr 15 07:38 /dev/gpt/efiboot0
> crw-r-----  1 root operator 0x7a Apr 15 07:38 /dev/gpt/swap0
> crw-r-----  1 root operator 0x7c Apr 15 07:38 /dev/gpt/zfs0
> crw-r-----  1 root operator 0x79 Apr 15 07:38 /dev/gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05
> crw-r-----  1 root operator 0x7b Apr 15 07:38 /dev/gptid/d735e388-8513-11f0-b9c7-589cfc02bf05
> crw-r-----  1 root operator 0x7d Apr 15 07:38 /dev/gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05

So all is fine. There is bug in the debug logging code.
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2026-04-15 08:02:15 UTC
After a trivial fix I see:
> # dmesg | grep GEOM_
> GEOM_LABEL[2]: Tasting nda0.
> GEOM_LABEL[1]: MSDOSFS: nda0: no FAT volume detected.
> GEOM_LABEL[1]: Label for provider nda0 is diskid/DISK-nvme0.
> GEOM_LABEL[2]: Tasting nda0p1.
> GEOM_LABEL[1]: Label for provider nda0p1 is gpt/efiboot0.
> GEOM_LABEL[1]: Label for provider nda0p1 is gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: nda0p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting nda0p2.
> GEOM_LABEL[1]: Label for provider nda0p2 is gpt/swap0.
> GEOM_LABEL[1]: Label for provider nda0p2 is gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting nda0p3.
> GEOM_LABEL[1]: Label for provider nda0p3 is gpt/zfs0.
> GEOM_LABEL[1]: Label for provider nda0p3 is gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[1]: MSDOSFS: nda0p3: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0.
> GEOM_LABEL[2]: Tasting gpt/efiboot0.
> GEOM_LABEL[2]: Tasting gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/swap0.
> GEOM_LABEL[2]: Tasting gptid/d735e388-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting gpt/zfs0.
> GEOM_LABEL[2]: Tasting gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p1.
> GEOM_LABEL[1]: Label efiboot0 (gpt/efiboot0) already exists (gpt/efiboot0).
> GEOM_LABEL[1]: Label d73082c2-8513-11f0-b9c7-589cfc02bf05 (gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05) already exists (gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p1: FAT12/FAT16 volume detected.
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p1: FAT12/16 volume has no name.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p2.
> GEOM_LABEL[1]: Label swap0 (gpt/swap0) already exists (gpt/swap0).
> GEOM_LABEL[1]: Label d735e388-8513-11f0-b9c7-589cfc02bf05 (gptid/d735e388-8513-11f0-b9c7-589cfc02bf05) already exists (gptid/d735e388-8513-11f0-b9c7-589cfc02bf05).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p2: no FAT signature found.
> GEOM_LABEL[2]: Tasting diskid/DISK-nvme0p3.
> GEOM_LABEL[1]: Label zfs0 (gpt/zfs0) already exists (gpt/zfs0).
> GEOM_LABEL[1]: Label d73ccc9a-8513-11f0-b9c7-589cfc02bf05 (gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05) already exists (gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05).
> GEOM_LABEL[1]: MSDOSFS: diskid/DISK-nvme0p3: no FAT signature found.
> GEOM_LABEL[1]: Label diskid/DISK-nvme0 removed.
> GEOM_LABEL[1]: Label gptid/d73ccc9a-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[2]: Tasting nda0.
> GEOM_LABEL[2]: Tasting gpt/zfs0.
> GEOM_LABEL[1]: Label gptid/d735e388-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[1]: Label gptid/d73082c2-8513-11f0-b9c7-589cfc02bf05 removed.
> GEOM_LABEL[2]: Tasting gpt/efiboot0.
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2026-04-15 08:14:03 UTC
ยด
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-04-15 18:19:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=92c69c791c436eb966fab806393b70e53cde6874

commit 92c69c791c436eb966fab806393b70e53cde6874
Author:     Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-04-14 08:38:59 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-04-15 18:18:32 +0000

    glabel(8): Fix debug message for already existing labels

    Remove the duplicate (incorrect) name.

    PR:             294542
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D56400

 sys/geom/label/g_label.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-04-22 09:32:05 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=c93e8b63d62b4d4dc4cb5386afe63d5a517b8b4b

commit c93e8b63d62b4d4dc4cb5386afe63d5a517b8b4b
Author:     Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-04-14 08:38:59 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-04-22 09:30:27 +0000

    glabel(8): Fix debug message for already existing labels

    Remove the duplicate (incorrect) name.

    PR:             294542
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D56400

    (cherry picked from commit 92c69c791c436eb966fab806393b70e53cde6874)

 sys/geom/label/g_label.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-04-22 09:32:06 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5131d206877c7926cc8c887d8d91e2dbb65ca1e5

commit 5131d206877c7926cc8c887d8d91e2dbb65ca1e5
Author:     Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-04-14 08:38:59 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-04-22 09:31:41 +0000

    glabel(8): Fix debug message for already existing labels

    Remove the duplicate (incorrect) name.

    PR:             294542
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D56400

    (cherry picked from commit 92c69c791c436eb966fab806393b70e53cde6874)

 sys/geom/label/g_label.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-04-22 09:35:07 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0fda88fa010fab36cfa4e1965c6b84d6f5ca5655

commit 0fda88fa010fab36cfa4e1965c6b84d6f5ca5655
Author:     Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-04-14 08:38:59 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-04-22 09:34:30 +0000

    glabel(8): Fix debug message for already existing labels

    Remove the duplicate (incorrect) name.

    PR:             294542
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D56400

    (cherry picked from commit 92c69c791c436eb966fab806393b70e53cde6874)

 sys/geom/label/g_label.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)