bin/144214: zfsboot fails on gang block after upgrade to zfs v14

Andriy Gapon avg at icyb.net.ua
Fri May 14 18:20:08 UTC 2010


The following reply was made to PR bin/144214; it has been noted by GNATS.

From: Andriy Gapon <avg at icyb.net.ua>
To: Volodymyr Kostyrko <c.kworr at gmail.com>
Cc: bug-followup <bug-followup at freebsd.org>,
        Robert Noland <rnoland at freebsd.org>
Subject: Re: bin/144214: zfsboot fails on gang block after upgrade to zfs
 v14
Date: Fri, 14 May 2010 21:15:31 +0300

 on 14/05/2010 17:12 Volodymyr Kostyrko said the following:
 > 2010/5/13 Andriy Gapon <avg at icyb.net.ua>:
 >> It seems that I have been misunderstanding the problem.
 >> "ZFS: gang block detected" won't even appear if boot code is too old.
 >>
 >> Having briefly glanced over the code and comparing it to the code in osol and in
 >> zio_gang_tree_issue(), I think the following change is needed.
 >> But I am not sure if it is a real fix for the issue at hand.
 >>
 >> If anyone can reproduce the problem, could you please test this change?
 >> Thanks!
 > 
 > Tested it. Same problem.
 
 Sigh.  I almost do not see any other obvious differences with other code that is
 supposed to support gang blocks.
 
 > 1. Rebuild and reinstall on i386. Filling disk up (600M free of 120G, 0.5%).
 > 2. Immediately after starting boot screen bursts into psychic colors.
 > Computer reboots.
 
 With unpatched boot code I presume?
 
 > 3. Booted from ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201004/FreeBSD-8.0-STABLE-201004-i386-livefs.iso
 > in VirtualBox i386. Boot code updated with dd.
 
 Have you updated both both part of zfsboot and loader?
 Are you sure that you used patched versions? (asking just in case)
 
 > 4. Same as p2. in vBox i386 takes looong time to rotate dash then
 > spits "ZFS: gang block detected" and hangs.
 
 Nothing else get printed?
 Asking because of this screenshot:
 http://danger.rulez.sk/dockdrop/144214.png
 
 > 5. Booted from amd64 install, updated boot code with dd.
 > 6. Booted on amd64. Immediately after starting boot spits out "ZFS:
 > gang block detected" and hangs.
 > 7. Booted from amd64 install. /boot transferred transferred to/from other disk.
 > 8. Booted on amd64. Immediately after starting boot spits out "ZFS:
 > gang block detected" and hangs.
 
 amd64 has exactly the same boot code that i386 has, perhaps some difference
 could arise during compilation, but even if so, it should not matter much in our
 case.
 
 > 9. Booted from amd64 install. Some files deleted (800M free, files
 > were written contiguously). /boot transferred transferred to/from
 > other disk.
 > 10. Booted on amd64.
 
 Not interested much in the workarounds - if they work, then OK, but mainly we
 are trying to fix the boot code.  Only behavior of installed zfsboot and
 zfsloader are interesting to us.
 
 > Results:
 > 1. Patch changes something. However zfsloader(?) still can't be read completely.
 > 2. Bug can happen on amd64. More extreme conditions needed(?).
 > 3. I'll post a follow-up on successfully booting on original i386 hardware.
 
 Can you please also share output of 'zfs get all' for the boot filesystem?
 Thank you for your help!
 
 And one last thing that I could think of:
 --- a/sys/boot/zfs/zfsimpl.c
 +++ b/sys/boot/zfs/zfsimpl.c
 @@ -1001,7 +1001,7 @@ zio_read(spa_t *spa, const blkptr_t *bp, void *buf)
  		if (DVA_GET_GANG(dva)) {
  			printf("ZFS: gang block detected!\n");
  			if (zio_read_gang(spa, bp, dva, buf))
 -				return (EIO);
 +				continue;
  		} else {
  			vdevid = DVA_GET_VDEV(dva);
  			offset = DVA_GET_OFFSET(dva);
 
 This should be applied in addition to the previous patch.
 If this still doesn't work, the it would make sense to add printfs in various
 places of zio_read_gang() function to try to see what happens there.
 
 -- 
 Andriy Gapon


More information about the freebsd-fs mailing list