Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2016 19:38:31 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308776 - head/sys/boot/zfs
Message-ID:  <201611171938.uAHJcVIe076703@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Nov 17 19:38:30 2016
New Revision: 308776
URL: https://svnweb.freebsd.org/changeset/base/308776

Log:
  loader: zfs toplevel vdev must have spa set.
  
  The salt based checksum mechanisms, such as skein, are storing the seed
  in spa structure, and need to access the spa to use the seed. The current
  mechanism for quick access to correct spa is via pointer provided by
  vdev structure, but unfortunately the current code does set spa only
  for the leaf vdev. This patch will fix the issue by making sure the
  loader zfs reader will set spa also for top-level vdevs.
  
  PR:		214375
  Reported by:	lstewart
  Reviewed by:	allanjude, imp
  Approved by:	allanjude (mentor), imp (mentor)
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D8487

Modified:
  head/sys/boot/zfs/zfsimpl.c

Modified: head/sys/boot/zfs/zfsimpl.c
==============================================================================
--- head/sys/boot/zfs/zfsimpl.c	Thu Nov 17 19:02:25 2016	(r308775)
+++ head/sys/boot/zfs/zfsimpl.c	Thu Nov 17 19:38:30 2016	(r308776)
@@ -1049,8 +1049,10 @@ vdev_probe(vdev_phys_read_t *read, void 
 	STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink)
 		if (top_vdev == pool_vdev)
 			break;
-	if (!pool_vdev && top_vdev)
+	if (!pool_vdev && top_vdev) {
+		top_vdev->spa = spa;
 		STAILQ_INSERT_TAIL(&spa->spa_vdevs, top_vdev, v_childlink);
+	}
 
 	/*
 	 * We should already have created an incomplete vdev for this



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611171938.uAHJcVIe076703>