Date: Wed, 17 May 2023 01:20:02 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271462] zpool list may wrongly report allocation of zero bytes Message-ID: <bug-271462-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271462 Bug ID: 271462 Summary: zpool list may wrongly report allocation of zero bytes Product: Base System Version: 13.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: dclarke@blastwave.org Two zpools were imported as readonly :=20 pluto# zpool import pool: tank id: 2737444605056550389 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: tank ONLINE ada1p4 ONLINE pool: p0 id: 13515875225729946510 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: p0 ONLINE mirror-0 ONLINE ada0p4 ONLINE gpt/zfs1 ONLINE ada2p1 ONLINE pluto#=20 pluto# zpool import -f -o readonly=3Don -o cachefile=3Dnone -o autotrim=3Do= ff -N -R /mnt/p0 13515875225729946510 pluto# zpool import -f -o readonly=3Don -o cachefile=3Dnone -o autotrim=3Do= ff -N -R /mnt/tank 2737444605056550389 pluto#=20 I was surprised to see that a zpool imported may show zero bytes allocated :=20 pluto# zpool list -v -p NAME SIZE ALLOC FREE CKPOINT EXPANDSZ= =20=20 FRAG CAP DEDUP HEALTH ALTROOT p0 15942918602752 0 15942918602752 - -= =20=20=20=20 0 0 1.00 ONLINE /mnt/p0 mirror-0 7971459301376 0 7971459301376 - - 0= =20=20=20=20 0 - ONLINE ada0p4 7984109322240 - - - - - -= =20=20=20=20=20 - ONLINE gpt/zfs1 7984109322240 - - - - - -= =20=20=20=20=20 - ONLINE ada2p1 7984109584384 0 7971459301376 - - 0= =20=20=20=20 0 - ONLINE tank 15977278341120 0 15977278341120 - -= =20=20=20=20 0 0 1.00 ONLINE /mnt/tank ada1p4 15983451570176 0 15977278341120 - - = 0=20=20 0 - ONLINE z0 987842478080 1774287360 986068190720 - -= =20=20=20=20 0 0 1.00 ONLINE - ada3p4 995640737792 1774287360 986068190720 - - = 0=20 0 - ONLINE pluto#=20 There we see two pools with 0 bytes allocated. This is very wrong. I can then export the pools :=20 pluto#=20 pluto# zpool export p0 pluto# zpool export tank pluto#=20 pluto# zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH= =20 ALTROOT z0 920G 1.65G 918G - - 0% 0% 1.00x ONLINE= - pluto#=20 Perform the import again without the readonly options etc :=20 pluto#=20 pluto# zpool import -f -N -R /mnt/p0 13515875225729946510 pluto#=20 pluto# zpool list=20 NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH= =20 ALTROOT p0 14.5T 10.1T 4.40T - - 17% 69% 1.00x ONLINE= =20 /mnt/p0 z0 920G 1.65G 918G - - 0% 0% 1.00x ONLINE= - pluto#=20 pluto# zpool import -f -N -R /mnt/tank 2737444605056550389 pluto#=20 pluto# zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH= =20 ALTROOT p0 14.5T 10.1T 4.40T - - 17% 69% 1.00x ONLINE= =20 /mnt/p0 tank 14.5T 9.91T 4.62T - - 0% 68% 1.00x ONLINE= =20 /mnt/tank z0 920G 1.65G 918G - - 0% 0% 1.00x ONLINE= - pluto#=20 pluto# zpool list -v -p p0 NAME SIZE ALLOC FREE CKPOINT EXPAN= DSZ=20 FRAG CAP DEDUP HEALTH ALTROOT p0 15942918602752 11108432945152 4834485657600 - = -=20 17 69 1.00 ONLINE /mnt/p0 mirror-0 7971459301376 7394602434560 576856866816 - -= =20=20=20=20 25 92 - ONLINE ada0p4 7984109322240 - - - - - -= =20=20=20=20=20 - ONLINE gpt/zfs1 7984109322240 - - - - - -= =20=20=20=20=20 - ONLINE ada2p1 7984109584384 3713830510592 4257628790784 - = -=20=20=20 9 46 - ONLINE pluto#=20 Those numbers look correct. Seems as if the options previously used in the import cause some confusion about the allocation in the vdevs and the pools themselves. Dennis Clarke --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271462-227>