author | Chris Kirby <Chris.Kirby@oracle.com> |
Thu, 10 Jun 2010 15:46:47 -0600 | |
changeset 12605 | 6790e683d5a5 |
parent 11958 | 575ffe1e978d |
child 13570 | 3411fd5f1589 |
permissions | -rw-r--r-- |
789 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
5329 | 5 |
* Common Development and Distribution License (the "License"). |
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 |
/* |
|
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10594
diff
changeset
|
22 |
* Copyright 2010 Sun Microsystems, Inc. All rights reserved. |
789 | 23 |
* Use is subject to license terms. |
24 |
*/ |
|
25 |
||
26 |
/* |
|
27 |
* The 'missing' vdev is a special vdev type used only during import. It |
|
28 |
* signifies a placeholder in the root vdev for some vdev that we know is |
|
29 |
* missing. We pass it down to the kernel to allow the rest of the |
|
30 |
* configuration to parsed and an attempt made to open all available devices. |
|
31 |
* Because its GUID is always 0, we know that the guid sum will mismatch and we |
|
32 |
* won't be able to open the pool anyway. |
|
33 |
*/ |
|
34 |
||
35 |
#include <sys/zfs_context.h> |
|
36 |
#include <sys/spa.h> |
|
37 |
#include <sys/vdev_impl.h> |
|
38 |
#include <sys/fs/zfs.h> |
|
39 |
#include <sys/zio.h> |
|
40 |
||
41 |
/* ARGSUSED */ |
|
42 |
static int |
|
43 |
vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) |
|
44 |
{ |
|
45 |
/* |
|
46 |
* Really this should just fail. But then the root vdev will be in the |
|
47 |
* faulted state with VDEV_AUX_NO_REPLICAS, when what we really want is |
|
48 |
* VDEV_AUX_BAD_GUID_SUM. So we pretend to succeed, knowing that we |
|
49 |
* will fail the GUID sum check before ever trying to open the pool. |
|
50 |
*/ |
|
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
51 |
*psize = 0; |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
52 |
*ashift = 0; |
789 | 53 |
return (0); |
54 |
} |
|
55 |
||
56 |
/* ARGSUSED */ |
|
57 |
static void |
|
58 |
vdev_missing_close(vdev_t *vd) |
|
59 |
{ |
|
60 |
} |
|
61 |
||
62 |
/* ARGSUSED */ |
|
5530 | 63 |
static int |
789 | 64 |
vdev_missing_io_start(zio_t *zio) |
65 |
{ |
|
66 |
zio->io_error = ENOTSUP; |
|
5530 | 67 |
return (ZIO_PIPELINE_CONTINUE); |
789 | 68 |
} |
69 |
||
70 |
/* ARGSUSED */ |
|
7754
b80e4842ad54
6754011 SPA 3.0: lock breakup, i/o pipeline refactoring, device failure handling
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents:
5530
diff
changeset
|
71 |
static void |
789 | 72 |
vdev_missing_io_done(zio_t *zio) |
73 |
{ |
|
5329 | 74 |
} |
75 |
||
789 | 76 |
vdev_ops_t vdev_missing_ops = { |
77 |
vdev_missing_open, |
|
78 |
vdev_missing_close, |
|
79 |
vdev_default_asize, |
|
80 |
vdev_missing_io_start, |
|
81 |
vdev_missing_io_done, |
|
82 |
NULL, |
|
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10594
diff
changeset
|
83 |
NULL, |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10594
diff
changeset
|
84 |
NULL, |
789 | 85 |
VDEV_TYPE_MISSING, /* name of this vdev type */ |
86 |
B_TRUE /* leaf vdev */ |
|
87 |
}; |
|
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
88 |
|
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
89 |
vdev_ops_t vdev_hole_ops = { |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
90 |
vdev_missing_open, |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
91 |
vdev_missing_close, |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
92 |
vdev_default_asize, |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
93 |
vdev_missing_io_start, |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
94 |
vdev_missing_io_done, |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
95 |
NULL, |
11958
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10594
diff
changeset
|
96 |
NULL, |
575ffe1e978d
6923585 deadlock while booting OpenSolaris build 132 from mirrored rpool with removed submirror
George Wilson <George.Wilson@Sun.COM>
parents:
10594
diff
changeset
|
97 |
NULL, |
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
98 |
VDEV_TYPE_HOLE, /* name of this vdev type */ |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
99 |
B_TRUE /* leaf vdev */ |
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
7754
diff
changeset
|
100 |
}; |