author | George Wilson <George.Wilson@Sun.COM> |
Fri, 23 Oct 2009 12:21:48 -0700 | |
changeset 10850 | bb29ac73664d |
parent 10614 | 4f397871da47 |
child 11958 | 575ffe1e978d |
permissions | -rw-r--r-- |
789 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
1489
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
789 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
21 |
/* |
|
8876
59d2e67b4b65
6803822 Reboot after replacement of system disk in a ZFS mirror drops to grub> prompt
Lin Ling <Lin.Ling@Sun.COM>
parents:
8269
diff
changeset
|
22 |
* Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
789 | 23 |
* Use is subject to license terms. |
24 |
*/ |
|
25 |
||
26 |
#include <sys/zfs_context.h> |
|
27 |
#include <sys/spa.h> |
|
6423 | 28 |
#include <sys/refcount.h> |
789 | 29 |
#include <sys/vdev_disk.h> |
30 |
#include <sys/vdev_impl.h> |
|
31 |
#include <sys/fs/zfs.h> |
|
32 |
#include <sys/zio.h> |
|
1171 | 33 |
#include <sys/sunldi.h> |
6976
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
34 |
#include <sys/fm/fs/zfs.h> |
789 | 35 |
|
36 |
/* |
|
37 |
* Virtual device vector for disks. |
|
38 |
*/ |
|
39 |
||
40 |
extern ldi_ident_t zfs_li; |
|
41 |
||
42 |
typedef struct vdev_disk_buf { |
|
43 |
buf_t vdb_buf; |
|
44 |
zio_t *vdb_io; |
|
45 |
} vdev_disk_buf_t; |
|
46 |
||
47 |
static int |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
48 |
vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) |
789 | 49 |
{ |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
50 |
spa_t *spa = vd->vdev_spa; |
789 | 51 |
vdev_disk_t *dvd; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
52 |
struct dk_minfo dkm; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
53 |
int error; |
5329 | 54 |
dev_t dev; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
55 |
int otyp; |
789 | 56 |
|
57 |
/* |
|
58 |
* We must have a pathname, and it must be absolute. |
|
59 |
*/ |
|
60 |
if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { |
|
61 |
vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; |
|
62 |
return (EINVAL); |
|
63 |
} |
|
64 |
||
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
65 |
/* |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
66 |
* Reopen the device if it's not currently open. Otherwise, |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
67 |
* just update the physical size of the device. |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
68 |
*/ |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
69 |
if (vd->vdev_tsd != NULL) { |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
70 |
ASSERT(vd->vdev_reopening); |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
71 |
dvd = vd->vdev_tsd; |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
72 |
goto skip_open; |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
73 |
} |
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
74 |
|
789 | 75 |
dvd = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_disk_t), KM_SLEEP); |
76 |
||
77 |
/* |
|
78 |
* When opening a disk device, we want to preserve the user's original |
|
79 |
* intent. We always want to open the device by the path the user gave |
|
80 |
* us, even if it is one of multiple paths to the save device. But we |
|
81 |
* also want to be able to survive disks being removed/recabled. |
|
82 |
* Therefore the sequence of opening devices is: |
|
83 |
* |
|
1171 | 84 |
* 1. Try opening the device by path. For legacy pools without the |
85 |
* 'whole_disk' property, attempt to fix the path by appending 's0'. |
|
789 | 86 |
* |
87 |
* 2. If the devid of the device matches the stored value, return |
|
88 |
* success. |
|
89 |
* |
|
90 |
* 3. Otherwise, the device may have moved. Try opening the device |
|
91 |
* by the devid instead. |
|
92 |
*/ |
|
93 |
if (vd->vdev_devid != NULL) { |
|
94 |
if (ddi_devid_str_decode(vd->vdev_devid, &dvd->vd_devid, |
|
95 |
&dvd->vd_minor) != 0) { |
|
96 |
vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; |
|
97 |
return (EINVAL); |
|
98 |
} |
|
99 |
} |
|
100 |
||
101 |
error = EINVAL; /* presume failure */ |
|
102 |
||
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
103 |
if (vd->vdev_path != NULL) { |
789 | 104 |
ddi_devid_t devid; |
105 |
||
1171 | 106 |
if (vd->vdev_wholedisk == -1ULL) { |
107 |
size_t len = strlen(vd->vdev_path) + 3; |
|
108 |
char *buf = kmem_alloc(len, KM_SLEEP); |
|
109 |
ldi_handle_t lh; |
|
110 |
||
111 |
(void) snprintf(buf, len, "%ss0", vd->vdev_path); |
|
789 | 112 |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
113 |
if (ldi_open_by_name(buf, spa_mode(spa), kcred, |
1171 | 114 |
&lh, zfs_li) == 0) { |
115 |
spa_strfree(vd->vdev_path); |
|
116 |
vd->vdev_path = buf; |
|
117 |
vd->vdev_wholedisk = 1ULL; |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
118 |
(void) ldi_close(lh, spa_mode(spa), kcred); |
1171 | 119 |
} else { |
120 |
kmem_free(buf, len); |
|
121 |
} |
|
122 |
} |
|
789 | 123 |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
124 |
error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), kcred, |
1171 | 125 |
&dvd->vd_lh, zfs_li); |
789 | 126 |
|
127 |
/* |
|
128 |
* Compare the devid to the stored value. |
|
129 |
*/ |
|
130 |
if (error == 0 && vd->vdev_devid != NULL && |
|
131 |
ldi_get_devid(dvd->vd_lh, &devid) == 0) { |
|
132 |
if (ddi_devid_compare(devid, dvd->vd_devid) != 0) { |
|
133 |
error = EINVAL; |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
134 |
(void) ldi_close(dvd->vd_lh, spa_mode(spa), |
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
135 |
kcred); |
789 | 136 |
dvd->vd_lh = NULL; |
137 |
} |
|
138 |
ddi_devid_free(devid); |
|
139 |
} |
|
1171 | 140 |
|
141 |
/* |
|
142 |
* If we succeeded in opening the device, but 'vdev_wholedisk' |
|
143 |
* is not yet set, then this must be a slice. |
|
144 |
*/ |
|
145 |
if (error == 0 && vd->vdev_wholedisk == -1ULL) |
|
146 |
vd->vdev_wholedisk = 0; |
|
789 | 147 |
} |
148 |
||
149 |
/* |
|
150 |
* If we were unable to open by path, or the devid check fails, open by |
|
151 |
* devid instead. |
|
152 |
*/ |
|
153 |
if (error != 0 && vd->vdev_devid != NULL) |
|
154 |
error = ldi_open_by_devid(dvd->vd_devid, dvd->vd_minor, |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
155 |
spa_mode(spa), kcred, &dvd->vd_lh, zfs_li); |
789 | 156 |
|
4451 | 157 |
/* |
158 |
* If all else fails, then try opening by physical path (if available) |
|
159 |
* or the logical path (if we failed due to the devid check). While not |
|
160 |
* as reliable as the devid, this will give us something, and the higher |
|
161 |
* level vdev validation will prevent us from opening the wrong device. |
|
162 |
*/ |
|
163 |
if (error) { |
|
164 |
if (vd->vdev_physpath != NULL && |
|
8269
03a7e9050cfd
6674216 "zfs share" doesn't work, but "zfs set sharenfs=on" does
Mark J Musante <Mark.Musante@Sun.COM>
parents:
8241
diff
changeset
|
165 |
(dev = ddi_pathname_to_dev_t(vd->vdev_physpath)) != NODEV) |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
166 |
error = ldi_open_by_dev(&dev, OTYP_BLK, spa_mode(spa), |
4451 | 167 |
kcred, &dvd->vd_lh, zfs_li); |
168 |
||
169 |
/* |
|
170 |
* Note that we don't support the legacy auto-wholedisk support |
|
171 |
* as above. This hasn't been used in a very long time and we |
|
172 |
* don't need to propagate its oddities to this edge condition. |
|
173 |
*/ |
|
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
174 |
if (error && vd->vdev_path != NULL) |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
175 |
error = ldi_open_by_name(vd->vdev_path, spa_mode(spa), |
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
176 |
kcred, &dvd->vd_lh, zfs_li); |
4451 | 177 |
} |
178 |
||
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
179 |
if (error) { |
789 | 180 |
vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
181 |
return (error); |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
182 |
} |
5329 | 183 |
|
789 | 184 |
/* |
4451 | 185 |
* Once a device is opened, verify that the physical device path (if |
186 |
* available) is up to date. |
|
187 |
*/ |
|
188 |
if (ldi_get_dev(dvd->vd_lh, &dev) == 0 && |
|
189 |
ldi_get_otyp(dvd->vd_lh, &otyp) == 0) { |
|
5329 | 190 |
char *physpath, *minorname; |
191 |
||
4451 | 192 |
physpath = kmem_alloc(MAXPATHLEN, KM_SLEEP); |
193 |
minorname = NULL; |
|
194 |
if (ddi_dev_pathname(dev, otyp, physpath) == 0 && |
|
195 |
ldi_get_minor_name(dvd->vd_lh, &minorname) == 0 && |
|
196 |
(vd->vdev_physpath == NULL || |
|
197 |
strcmp(vd->vdev_physpath, physpath) != 0)) { |
|
198 |
if (vd->vdev_physpath) |
|
199 |
spa_strfree(vd->vdev_physpath); |
|
200 |
(void) strlcat(physpath, ":", MAXPATHLEN); |
|
201 |
(void) strlcat(physpath, minorname, MAXPATHLEN); |
|
202 |
vd->vdev_physpath = spa_strdup(physpath); |
|
203 |
} |
|
204 |
if (minorname) |
|
205 |
kmem_free(minorname, strlen(minorname) + 1); |
|
206 |
kmem_free(physpath, MAXPATHLEN); |
|
207 |
} |
|
208 |
||
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
209 |
skip_open: |
4451 | 210 |
/* |
789 | 211 |
* Determine the actual size of the device. |
212 |
*/ |
|
213 |
if (ldi_get_size(dvd->vd_lh, psize) != 0) { |
|
214 |
vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; |
|
215 |
return (EINVAL); |
|
216 |
} |
|
217 |
||
1732 | 218 |
/* |
219 |
* If we own the whole disk, try to enable disk write caching. |
|
220 |
* We ignore errors because it's OK if we can't do it. |
|
221 |
*/ |
|
1489
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
222 |
if (vd->vdev_wholedisk == 1) { |
1732 | 223 |
int wce = 1; |
224 |
(void) ldi_ioctl(dvd->vd_lh, DKIOCSETWCE, (intptr_t)&wce, |
|
225 |
FKIOCTL, kcred, NULL); |
|
226 |
} |
|
1489
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
227 |
|
1732 | 228 |
/* |
229 |
* Determine the device's minimum transfer size. |
|
230 |
* If the ioctl isn't supported, assume DEV_BSIZE. |
|
231 |
*/ |
|
232 |
if (ldi_ioctl(dvd->vd_lh, DKIOCGMEDIAINFO, (intptr_t)&dkm, |
|
233 |
FKIOCTL, kcred, NULL) != 0) |
|
234 |
dkm.dki_lbsize = DEV_BSIZE; |
|
1489
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
235 |
|
1732 | 236 |
*ashift = highbit(MAX(dkm.dki_lbsize, SPA_MINBLOCKSIZE)) - 1; |
1489
fa842259660e
6322205 Enable disk write cache if ZFS owns the disk
webaker
parents:
1171
diff
changeset
|
237 |
|
1773
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
238 |
/* |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
239 |
* Clear the nowritecache bit, so that on a vdev_reopen() we will |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
240 |
* try again. |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
241 |
*/ |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
242 |
vd->vdev_nowritecache = B_FALSE; |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
243 |
|
789 | 244 |
return (0); |
245 |
} |
|
246 |
||
247 |
static void |
|
248 |
vdev_disk_close(vdev_t *vd) |
|
249 |
{ |
|
250 |
vdev_disk_t *dvd = vd->vdev_tsd; |
|
251 |
||
10850
bb29ac73664d
6840704 osol_0906 PV guests sometimes hang at login prompt
George Wilson <George.Wilson@Sun.COM>
parents:
10614
diff
changeset
|
252 |
if (vd->vdev_reopening || dvd == NULL) |
789 | 253 |
return; |
254 |
||
255 |
if (dvd->vd_minor != NULL) |
|
256 |
ddi_devid_str_free(dvd->vd_minor); |
|
257 |
||
258 |
if (dvd->vd_devid != NULL) |
|
259 |
ddi_devid_free(dvd->vd_devid); |
|
260 |
||
261 |
if (dvd->vd_lh != NULL) |
|
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
262 |
(void) ldi_close(dvd->vd_lh, spa_mode(vd->vdev_spa), kcred); |
789 | 263 |
|
264 |
kmem_free(dvd, sizeof (vdev_disk_t)); |
|
265 |
vd->vdev_tsd = NULL; |
|
266 |
} |
|
267 |
||
6423 | 268 |
int |
269 |
vdev_disk_physio(ldi_handle_t vd_lh, caddr_t data, size_t size, |
|
270 |
uint64_t offset, int flags) |
|
271 |
{ |
|
272 |
buf_t *bp; |
|
273 |
int error = 0; |
|
274 |
||
275 |
if (vd_lh == NULL) |
|
276 |
return (EINVAL); |
|
277 |
||
278 |
ASSERT(flags & B_READ || flags & B_WRITE); |
|
279 |
||
280 |
bp = getrbuf(KM_SLEEP); |
|
281 |
bp->b_flags = flags | B_BUSY | B_NOCACHE | B_FAILFAST; |
|
282 |
bp->b_bcount = size; |
|
283 |
bp->b_un.b_addr = (void *)data; |
|
284 |
bp->b_lblkno = lbtodb(offset); |
|
285 |
bp->b_bufsize = size; |
|
286 |
||
287 |
error = ldi_strategy(vd_lh, bp); |
|
288 |
ASSERT(error == 0); |
|
289 |
if ((error = biowait(bp)) == 0 && bp->b_resid != 0) |
|
290 |
error = EIO; |
|
291 |
freerbuf(bp); |
|
292 |
||
293 |
return (error); |
|
294 |
} |
|
295 |
||
789 | 296 |
static void |
297 |
vdev_disk_io_intr(buf_t *bp) |
|
298 |
{ |
|
299 |
vdev_disk_buf_t *vdb = (vdev_disk_buf_t *)bp; |
|
300 |
zio_t *zio = vdb->vdb_io; |
|
301 |
||
6976
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
302 |
/* |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
303 |
* The rest of the zio stack only deals with EIO, ECKSUM, and ENXIO. |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
304 |
* Rather than teach the rest of the stack about other error |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
305 |
* possibilities (EFAULT, etc), we normalize the error value here. |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
306 |
*/ |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
307 |
zio->io_error = (geterror(bp) != 0 ? EIO : 0); |
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
308 |
|
cae5f06df471
PSARC 2008/388 Short circuit for vdev probe failure
eschrock
parents:
6673
diff
changeset
|
309 |
if (zio->io_error == 0 && bp->b_resid != 0) |
789 | 310 |
zio->io_error = EIO; |
311 |
||
312 |
kmem_free(vdb, sizeof (vdev_disk_buf_t)); |
|
313 |
||
5530 | 314 |
zio_interrupt(zio); |
789 | 315 |
} |
316 |
||
317 |
static void |
|
7762
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
318 |
vdev_disk_ioctl_free(zio_t *zio) |
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
319 |
{ |
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
320 |
kmem_free(zio->io_vsd, sizeof (struct dk_callback)); |
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
321 |
} |
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
322 |
|
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
323 |
static const zio_vsd_ops_t vdev_disk_vsd_ops = { |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
324 |
vdev_disk_ioctl_free, |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
325 |
zio_vsd_default_cksum_report |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
326 |
}; |
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
327 |
|
7762
067dd33ef32c
6754498 assertion failure in dbuf_leaf_sync() - and test coverage gap in ztest
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7754
diff
changeset
|
328 |
static void |
789 | 329 |
vdev_disk_ioctl_done(void *zio_arg, int error) |
330 |
{ |
|
331 |
zio_t *zio = zio_arg; |
|
332 |
||
333 |
zio->io_error = error; |
|
334 |
||
5530 | 335 |
zio_interrupt(zio); |
789 | 336 |
} |
337 |
||
5530 | 338 |
static int |
789 | 339 |
vdev_disk_io_start(zio_t *zio) |
340 |
{ |
|
341 |
vdev_t *vd = zio->io_vd; |
|
342 |
vdev_disk_t *dvd = vd->vdev_tsd; |
|
343 |
vdev_disk_buf_t *vdb; |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
344 |
struct dk_callback *dkc; |
789 | 345 |
buf_t *bp; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
346 |
int error; |
789 | 347 |
|
348 |
if (zio->io_type == ZIO_TYPE_IOCTL) { |
|
349 |
/* XXPOLICY */ |
|
5329 | 350 |
if (!vdev_readable(vd)) { |
789 | 351 |
zio->io_error = ENXIO; |
5530 | 352 |
return (ZIO_PIPELINE_CONTINUE); |
789 | 353 |
} |
354 |
||
355 |
switch (zio->io_cmd) { |
|
356 |
||
357 |
case DKIOCFLUSHWRITECACHE: |
|
358 |
||
2885 | 359 |
if (zfs_nocacheflush) |
360 |
break; |
|
361 |
||
1773
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
362 |
if (vd->vdev_nowritecache) { |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
363 |
zio->io_error = ENOTSUP; |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
364 |
break; |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
365 |
} |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
366 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
367 |
zio->io_vsd = dkc = kmem_alloc(sizeof (*dkc), KM_SLEEP); |
10614
4f397871da47
PSARC 2009/497 zfs checksum ereport payload additions
Jonathan Adams <Jonathan.Adams@Sun.COM>
parents:
10575
diff
changeset
|
368 |
zio->io_vsd_ops = &vdev_disk_vsd_ops; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
369 |
|
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
370 |
dkc->dkc_callback = vdev_disk_ioctl_done; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
371 |
dkc->dkc_flag = FLUSH_VOLATILE; |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
372 |
dkc->dkc_cookie = zio; |
789 | 373 |
|
374 |
error = ldi_ioctl(dvd->vd_lh, zio->io_cmd, |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
375 |
(uintptr_t)dkc, FKIOCTL, kcred, NULL); |
789 | 376 |
|
377 |
if (error == 0) { |
|
378 |
/* |
|
379 |
* The ioctl will be done asychronously, |
|
380 |
* and will call vdev_disk_ioctl_done() |
|
381 |
* upon completion. |
|
382 |
*/ |
|
5530 | 383 |
return (ZIO_PIPELINE_STOP); |
384 |
} |
|
385 |
||
386 |
if (error == ENOTSUP || error == ENOTTY) { |
|
1773
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
387 |
/* |
4455
122ee9c0f54c
6456223 system hang after test suite run on usb disk
mishra
parents:
4451
diff
changeset
|
388 |
* If we get ENOTSUP or ENOTTY, we know that |
122ee9c0f54c
6456223 system hang after test suite run on usb disk
mishra
parents:
4451
diff
changeset
|
389 |
* no future attempts will ever succeed. |
122ee9c0f54c
6456223 system hang after test suite run on usb disk
mishra
parents:
4451
diff
changeset
|
390 |
* In this case we set a persistent bit so |
122ee9c0f54c
6456223 system hang after test suite run on usb disk
mishra
parents:
4451
diff
changeset
|
391 |
* that we don't bother with the ioctl in the |
122ee9c0f54c
6456223 system hang after test suite run on usb disk
mishra
parents:
4451
diff
changeset
|
392 |
* future. |
1773
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
393 |
*/ |
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
394 |
vd->vdev_nowritecache = B_TRUE; |
789 | 395 |
} |
396 |
zio->io_error = error; |
|
1773
d6e4f2855c14
6407791 bringover into ZFS results in s. files newer than extracted source
eschrock
parents:
1732
diff
changeset
|
397 |
|
789 | 398 |
break; |
399 |
||
400 |
default: |
|
401 |
zio->io_error = ENOTSUP; |
|
402 |
} |
|
403 |
||
5530 | 404 |
return (ZIO_PIPELINE_CONTINUE); |
789 | 405 |
} |
406 |
||
407 |
vdb = kmem_alloc(sizeof (vdev_disk_buf_t), KM_SLEEP); |
|
408 |
||
409 |
vdb->vdb_io = zio; |
|
410 |
bp = &vdb->vdb_buf; |
|
411 |
||
412 |
bioinit(bp); |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
413 |
bp->b_flags = B_BUSY | B_NOCACHE | |
9725
0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9616
diff
changeset
|
414 |
(zio->io_type == ZIO_TYPE_READ ? B_READ : B_WRITE); |
0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9616
diff
changeset
|
415 |
if (!(zio->io_flags & (ZIO_FLAG_IO_RETRY | ZIO_FLAG_TRYHARD))) |
0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9616
diff
changeset
|
416 |
bp->b_flags |= B_FAILFAST; |
789 | 417 |
bp->b_bcount = zio->io_size; |
418 |
bp->b_un.b_addr = zio->io_data; |
|
419 |
bp->b_lblkno = lbtodb(zio->io_offset); |
|
420 |
bp->b_bufsize = zio->io_size; |
|
421 |
bp->b_iodone = (int (*)())vdev_disk_io_intr; |
|
422 |
||
423 |
/* ldi_strategy() will return non-zero only on programming errors */ |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
424 |
VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0); |
5530 | 425 |
|
426 |
return (ZIO_PIPELINE_STOP); |
|
789 | 427 |
} |
428 |
||
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
429 |
static void |
789 | 430 |
vdev_disk_io_done(zio_t *zio) |
431 |
{ |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
432 |
vdev_t *vd = zio->io_vd; |
1544 | 433 |
|
4451 | 434 |
/* |
435 |
* If the device returned EIO, then attempt a DKIOCSTATE ioctl to see if |
|
436 |
* the device has been removed. If this is the case, then we trigger an |
|
5329 | 437 |
* asynchronous removal of the device. Otherwise, probe the device and |
5369
27c1235ef9a4
6621355 panic in vdev_disk_io_start when trying to write to a faulted device
gw25295
parents:
5329
diff
changeset
|
438 |
* make sure it's still accessible. |
4451 | 439 |
*/ |
10575
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
440 |
if (zio->io_error == EIO && !vd->vdev_remove_wanted) { |
5329 | 441 |
vdev_disk_t *dvd = vd->vdev_tsd; |
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
442 |
int state = DKIO_NONE; |
5329 | 443 |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
444 |
if (ldi_ioctl(dvd->vd_lh, DKIOCSTATE, (intptr_t)&state, |
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7687
diff
changeset
|
445 |
FKIOCTL, kcred, NULL) == 0 && state != DKIO_INSERTED) { |
10575
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
446 |
/* |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
447 |
* We post the resource as soon as possible, instead of |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
448 |
* when the async removal actually happens, because the |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
449 |
* DE is using this information to discard previous I/O |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
450 |
* errors. |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
451 |
*/ |
2a8816c5173b
6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9988
diff
changeset
|
452 |
zfs_post_remove(zio->io_spa, vd); |
4451 | 453 |
vd->vdev_remove_wanted = B_TRUE; |
454 |
spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE); |
|
455 |
} |
|
456 |
} |
|
789 | 457 |
} |
458 |
||
459 |
vdev_ops_t vdev_disk_ops = { |
|
460 |
vdev_disk_open, |
|
461 |
vdev_disk_close, |
|
462 |
vdev_default_asize, |
|
463 |
vdev_disk_io_start, |
|
464 |
vdev_disk_io_done, |
|
465 |
NULL, |
|
466 |
VDEV_TYPE_DISK, /* name of this vdev type */ |
|
467 |
B_TRUE /* leaf vdev */ |
|
468 |
}; |
|
6423 | 469 |
|
470 |
/* |
|
7147
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
471 |
* Given the root disk device devid or pathname, read the label from |
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
472 |
* the device, and construct a configuration nvlist. |
6423 | 473 |
*/ |
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
474 |
int |
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
475 |
vdev_disk_read_rootlabel(char *devpath, char *devid, nvlist_t **config) |
6423 | 476 |
{ |
477 |
ldi_handle_t vd_lh; |
|
478 |
vdev_label_t *label; |
|
479 |
uint64_t s, size; |
|
480 |
int l; |
|
7147
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
481 |
ddi_devid_t tmpdevid; |
7687
1132fbaf0c27
6750475 can't boot off a mirrored root with a failed disk
Lin Ling <Lin.Ling@Sun.COM>
parents:
7553
diff
changeset
|
482 |
int error = -1; |
7147
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
483 |
char *minor_name; |
6423 | 484 |
|
485 |
/* |
|
486 |
* Read the device label and build the nvlist. |
|
487 |
*/ |
|
7687
1132fbaf0c27
6750475 can't boot off a mirrored root with a failed disk
Lin Ling <Lin.Ling@Sun.COM>
parents:
7553
diff
changeset
|
488 |
if (devid != NULL && ddi_devid_str_decode(devid, &tmpdevid, |
7147
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
489 |
&minor_name) == 0) { |
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
490 |
error = ldi_open_by_devid(tmpdevid, minor_name, |
8241
5a60f16123ba
6328632 zpool offline is a bit too conservative
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
7762
diff
changeset
|
491 |
FREAD, kcred, &vd_lh, zfs_li); |
7147
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
492 |
ddi_devid_free(tmpdevid); |
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
493 |
ddi_devid_str_free(minor_name); |
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
494 |
} |
1e1d75c88283
6704717 ZFS mirrored root doesn't live up to expectations
taylor
parents:
6976
diff
changeset
|
495 |
|
7687
1132fbaf0c27
6750475 can't boot off a mirrored root with a failed disk
Lin Ling <Lin.Ling@Sun.COM>
parents:
7553
diff
changeset
|
496 |
if (error && (error = ldi_open_by_name(devpath, FREAD, kcred, &vd_lh, |
1132fbaf0c27
6750475 can't boot off a mirrored root with a failed disk
Lin Ling <Lin.Ling@Sun.COM>
parents:
7553
diff
changeset
|
497 |
zfs_li))) |
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
498 |
return (error); |
6423 | 499 |
|
6673
be079d6124af
6697301 deadlock between ZFS and devfs can hang system
eschrock
parents:
6615
diff
changeset
|
500 |
if (ldi_get_size(vd_lh, &s)) { |
be079d6124af
6697301 deadlock between ZFS and devfs can hang system
eschrock
parents:
6615
diff
changeset
|
501 |
(void) ldi_close(vd_lh, FREAD, kcred); |
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
502 |
return (EIO); |
6673
be079d6124af
6697301 deadlock between ZFS and devfs can hang system
eschrock
parents:
6615
diff
changeset
|
503 |
} |
6423 | 504 |
|
505 |
size = P2ALIGN_TYPED(s, sizeof (vdev_label_t), uint64_t); |
|
506 |
label = kmem_alloc(sizeof (vdev_label_t), KM_SLEEP); |
|
507 |
||
9616
b12e6357efad
6820274 grub could do a better job of finding a menu.lst file
Eric Taylor <Eric.Taylor@Sun.COM>
parents:
8876
diff
changeset
|
508 |
*config = NULL; |
6423 | 509 |
for (l = 0; l < VDEV_LABELS; l++) { |
510 |
uint64_t offset, state, txg = 0; |
|
511 |
||
512 |
/* read vdev label */ |
|
513 |
offset = vdev_label_offset(size, l, 0); |
|
514 |
if (vdev_disk_physio(vd_lh, (caddr_t)label, |
|
8876
59d2e67b4b65
6803822 Reboot after replacement of system disk in a ZFS mirror drops to grub> prompt
Lin Ling <Lin.Ling@Sun.COM>
parents:
8269
diff
changeset
|
515 |
VDEV_SKIP_SIZE + VDEV_PHYS_SIZE, offset, B_READ) != 0) |
6423 | 516 |
continue; |
517 |
||
518 |
if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist, |
|
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
519 |
sizeof (label->vl_vdev_phys.vp_nvlist), config, 0) != 0) { |
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
520 |
*config = NULL; |
6423 | 521 |
continue; |
522 |
} |
|
523 |
||
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
524 |
if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, |
6423 | 525 |
&state) != 0 || state >= POOL_STATE_DESTROYED) { |
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
526 |
nvlist_free(*config); |
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
527 |
*config = NULL; |
6423 | 528 |
continue; |
529 |
} |
|
530 |
||
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
531 |
if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, |
6423 | 532 |
&txg) != 0 || txg == 0) { |
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
533 |
nvlist_free(*config); |
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
534 |
*config = NULL; |
6423 | 535 |
continue; |
536 |
} |
|
537 |
||
538 |
break; |
|
539 |
} |
|
540 |
||
541 |
kmem_free(label, sizeof (vdev_label_t)); |
|
6673
be079d6124af
6697301 deadlock between ZFS and devfs can hang system
eschrock
parents:
6615
diff
changeset
|
542 |
(void) ldi_close(vd_lh, FREAD, kcred); |
9616
b12e6357efad
6820274 grub could do a better job of finding a menu.lst file
Eric Taylor <Eric.Taylor@Sun.COM>
parents:
8876
diff
changeset
|
543 |
if (*config == NULL) |
b12e6357efad
6820274 grub could do a better job of finding a menu.lst file
Eric Taylor <Eric.Taylor@Sun.COM>
parents:
8876
diff
changeset
|
544 |
error = EIDRM; |
6673
be079d6124af
6697301 deadlock between ZFS and devfs can hang system
eschrock
parents:
6615
diff
changeset
|
545 |
|
7539
e3f4b4b9f982
6724326 better "can't mountroot" message
Lin Ling <Lin.Ling@Sun.COM>
parents:
7147
diff
changeset
|
546 |
return (error); |
6423 | 547 |
} |