Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c =================================================================== RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c,v retrieving revision 1.3 diff -u -p -r1.3 vdev_label.c --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c 17 Nov 2008 20:49:29 -0000 1.3 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c 20 Aug 2009 08:57:18 -0000 @@ -142,6 +142,7 @@ #include #include #include +#include /* * Basic routines to read and write from a vdev label. @@ -714,9 +715,15 @@ vdev_label_init(vdev_t *vd, uint64_t crt * conflicting uberblocks on disk with the same txg. The solution is simple: * among uberblocks with equal txg, choose the one with the latest timestamp. */ +SYSCTL_DECL(_vfs_zfs); +static int maxtxg = -1; +SYSCTL_INT(_vfs_zfs, OID_AUTO, maxtxg, CTLFLAG_RW, &maxtxg, 0, ""); static int vdev_uberblock_compare(uberblock_t *ub1, uberblock_t *ub2) { + if (maxtxg != -1 && ub1->ub_txg > (uint64_t)maxtxg) + return (-1); + if (ub1->ub_txg < ub2->ub_txg) return (-1); if (ub1->ub_txg > ub2->ub_txg)