Eventhough r203504 eliminates taste traffic provoked by vdev_geom.c,

ZFS still like to open all vdevs, close them and open them again,
which in turn provokes taste traffic anyway.

I don't know of any clean way to fix it, so do it the hard way - if we can't
open provider for writing just retry 5 times with 0.5 pauses. This should
elimitate accidental races caused by other classes tasting providers created on
top of our vdevs.

MFC after:	3 days
Reported by:	James R. Van Artsdalen <james-freebsd-fs2@jrv.org>
Reported by:	Yuri Pankov <yuri.pankov@gmail.com>
This commit is contained in:
Pawel Jakub Dawidek 2010-05-11 22:29:00 +00:00
parent 58729dbfc4
commit 8423e00b36

View File

@ -530,8 +530,17 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
error = ENOENT;
} else if (cp->acw == 0 && (spa_mode & FWRITE) != 0) {
int i;
g_topology_lock();
error = g_access(cp, 0, 1, 0);
for (i = 0; i < 5; i++) {
error = g_access(cp, 0, 1, 0);
if (error == 0)
break;
g_topology_unlock();
tsleep(vd, 0, "vdev", hz / 2);
g_topology_lock();
}
if (error != 0) {
printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n",
vd->vdev_path, error);