Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144913127
D13278.id35892.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D13278.id35892.diff
View Options
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
@@ -851,35 +851,10 @@
if (cp == NULL) {
ZFS_LOG(1, "Vdev %s not found.", vd->vdev_path);
error = ENOENT;
- } else if (cp->provider->sectorsize > VDEV_PAD_SIZE ||
- !ISP2(cp->provider->sectorsize)) {
- ZFS_LOG(1, "Provider %s has unsupported sectorsize.",
- cp->provider->name);
-
- vdev_geom_close_locked(vd);
- error = EINVAL;
- cp = NULL;
- } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) {
- int i;
-
- 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",
- cp->provider->name, error);
- vdev_geom_close_locked(vd);
- cp = NULL;
- }
- }
- if (cp != NULL) {
+ } else {
struct consumer_priv_t *priv;
struct consumer_vdev_elem *elem;
+ int spamode;
priv = (struct consumer_priv_t*)&cp->private;
if (cp->private == NULL)
@@ -887,6 +862,34 @@
elem = g_malloc(sizeof(*elem), M_WAITOK|M_ZERO);
elem->vd = vd;
SLIST_INSERT_HEAD(priv, elem, elems);
+
+ spamode = spa_mode(vd->vdev_spa);
+ if (cp->provider->sectorsize > VDEV_PAD_SIZE ||
+ !ISP2(cp->provider->sectorsize)) {
+ ZFS_LOG(1, "Provider %s has unsupported sectorsize.",
+ cp->provider->name);
+
+ vdev_geom_close_locked(vd);
+ error = EINVAL;
+ cp = NULL;
+ } else if (cp->acw == 0 && (spamode & FWRITE) != 0) {
+ int i;
+
+ 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",
+ cp->provider->name, error);
+ vdev_geom_close_locked(vd);
+ cp = NULL;
+ }
+ }
}
/* Fetch initial physical path information for this device. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 1:25 AM (14 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28722010
Default Alt Text
D13278.id35892.diff (2 KB)
Attached To
Mode
D13278: Fix assertion when ZFS fails to open certain devices
Attached
Detach File
Event Timeline
Log In to Comment