Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 810e43b

Browse files
pijewskirmustacc
authored andcommitted
2932 support crash dumps to raidz, etc. pools
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Dan McDonald <danmcd@nexenta.com>
1 parent 1b3b16f commit 810e43b

File tree

15 files changed

+404
-63
lines changed

15 files changed

+404
-63
lines changed

usr/src/common/zfs/zfeature_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/*
2323
* Copyright (c) 2012 by Delphix. All rights reserved.
2424
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
2526
*/
2627

2728
#ifdef _KERNEL
@@ -160,4 +161,7 @@ zpool_feature_init(void)
160161
zfeature_register(SPA_FEATURE_LZ4_COMPRESS,
161162
"org.illumos:lz4_compress", "lz4_compress",
162163
"LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL);
164+
zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP,
165+
"com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump",
166+
"Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL);
163167
}

usr/src/common/zfs/zfeature_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/*
2323
* Copyright (c) 2012 by Delphix. All rights reserved.
2424
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
2526
*/
2627

2728
#ifndef _ZFEATURE_COMMON_H
@@ -54,6 +55,7 @@ enum spa_feature {
5455
SPA_FEATURE_ASYNC_DESTROY,
5556
SPA_FEATURE_EMPTY_BPOBJ,
5657
SPA_FEATURE_LZ4_COMPRESS,
58+
SPA_FEATURE_MULTI_VDEV_CRASH_DUMP,
5759
SPA_FEATURES
5860
} spa_feature_t;
5961

usr/src/common/zfs/zfs_prop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2323
* Copyright (c) 2012 by Delphix. All rights reserved.
2424
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
2526
*/
2627

2728
/* Portions Copyright 2010 Robert Milkowski */
@@ -69,6 +70,7 @@ zfs_prop_init(void)
6970
{ "fletcher2", ZIO_CHECKSUM_FLETCHER_2 },
7071
{ "fletcher4", ZIO_CHECKSUM_FLETCHER_4 },
7172
{ "sha256", ZIO_CHECKSUM_SHA256 },
73+
{ "noparity", ZIO_CHECKSUM_NOPARITY },
7274
{ NULL }
7375
};
7476

usr/src/lib/libzfs/common/libzfs_pool.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2424
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
2525
* Copyright (c) 2012 by Delphix. All rights reserved.
26+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
2627
*/
2728

2829
#include <ctype.h>
@@ -3958,9 +3959,7 @@ supported_dump_vdev_type(libzfs_handle_t *hdl, nvlist_t *config, char *errbuf)
39583959
uint_t children, c;
39593960

39603961
verify(nvlist_lookup_string(config, ZPOOL_CONFIG_TYPE, &type) == 0);
3961-
if (strcmp(type, VDEV_TYPE_RAIDZ) == 0 ||
3962-
strcmp(type, VDEV_TYPE_FILE) == 0 ||
3963-
strcmp(type, VDEV_TYPE_LOG) == 0 ||
3962+
if (strcmp(type, VDEV_TYPE_FILE) == 0 ||
39643963
strcmp(type, VDEV_TYPE_HOLE) == 0 ||
39653964
strcmp(type, VDEV_TYPE_MISSING) == 0) {
39663965
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -3979,8 +3978,12 @@ supported_dump_vdev_type(libzfs_handle_t *hdl, nvlist_t *config, char *errbuf)
39793978
}
39803979

39813980
/*
3982-
* check if this zvol is allowable for use as a dump device; zero if
3983-
* it is, > 0 if it isn't, < 0 if it isn't a zvol
3981+
* Check if this zvol is allowable for use as a dump device; zero if
3982+
* it is, > 0 if it isn't, < 0 if it isn't a zvol.
3983+
*
3984+
* Allowable storage configurations include mirrors, all raidz variants, and
3985+
* pools with log, cache, and spare devices. Pools which are backed by files or
3986+
* have missing/hole vdevs are not suitable.
39843987
*/
39853988
int
39863989
zvol_check_dump_config(char *arg)
@@ -4042,12 +4045,6 @@ zvol_check_dump_config(char *arg)
40424045

40434046
verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
40444047
&top, &toplevels) == 0);
4045-
if (toplevels != 1) {
4046-
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
4047-
"'%s' has multiple top level vdevs"), poolname);
4048-
(void) zfs_error(hdl, EZFS_DEVOVERFLOW, errbuf);
4049-
goto out;
4050-
}
40514048

40524049
if (!supported_dump_vdev_type(hdl, top[0], errbuf)) {
40534050
goto out;

usr/src/man/man1m/zfs.1m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
2424
.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
2525
.\" Copyright (c) 2012 by Delphix. All rights reserved.
26-
.\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
2726
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
2827
.\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved.
28+
.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
2929
.\"
3030
.TH ZFS 1M "Jan 26, 2013"
3131
.SH NAME
@@ -106,7 +106,7 @@ zfs \- configures ZFS file systems
106106

107107
.LP
108108
.nf
109-
\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...]
109+
\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...]
110110
[\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fBall\fR | \fIproperty\fR[,\fIproperty\fR]...
111111
\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...
112112
.fi
@@ -934,15 +934,18 @@ This property is not inherited.
934934
.ne 2
935935
.na
936936
\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2\fR | \fBfletcher4\fR |
937-
\fBsha256\fR\fR
937+
\fBsha256\fR | \fBnoparity\fR \fR
938938
.ad
939939
.sp .6
940940
.RS 4n
941941
Controls the checksum used to verify data integrity. The default value is
942942
\fBon\fR, which automatically selects an appropriate algorithm (currently,
943943
\fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR
944-
disables integrity checking on user data. Disabling checksums is \fBNOT\fR a
945-
recommended practice.
944+
disables integrity checking on user data. The value \fBnoparity\fR not only
945+
disables integrity but also disables maintaining parity for user data. This
946+
setting is used internally by a dump device residing on a RAID-Z pool and should
947+
not be used by any other dataset. Disabling checksums is \fBNOT\fR a recommended
948+
practice.
946949
.sp
947950
Changing this property affects only newly-written data.
948951
.RE

usr/src/man/man5/zpool-features.5

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'\" te
22
.\" Copyright (c) 2012 by Delphix. All rights reserved.
33
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
4+
.\" Copyright (c) 2013, Joyent, Inc. All rights reserved.
45
.\" The contents of this file are subject to the terms of the Common Development
56
.\" and Distribution License (the "License"). You may not use this file except
67
.\" in compliance with the License. You can obtain a copy of the license at
@@ -231,5 +232,26 @@ moment, this operation cannot be reversed. Booting off of
231232

232233
.RE
233234

235+
.sp
236+
.ne 2
237+
.na
238+
\fB\fBmulti_vdev_crash_dump\fR\fR
239+
.ad
240+
.RS 4n
241+
.TS
242+
l l .
243+
GUID com.joyent:multi_vdev_crash_dump
244+
READ\-ONLY COMPATIBLE no
245+
DEPENDENCIES none
246+
.TE
247+
248+
This feature allows a dump device to be configured with a pool comprised
249+
of multiple vdevs. Those vdevs may be arranged in any mirrored or raidz
250+
configuration.
251+
252+
When the \fBmulti_vdev_crash_dump\fR feature is set to \fBenabled\fR,
253+
the administrator can use the \fBdumpadm\fR(1M) command to configure a
254+
dump device on a pool comprised of multiple vdevs.
255+
234256
.SH "SEE ALSO"
235257
\fBzpool\fR(1M)

usr/src/uts/common/fs/zfs/dbuf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
2424
* Copyright (c) 2013 by Delphix. All rights reserved.
2525
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
2627
*/
2728

2829
#include <sys/zfs_context.h>
@@ -2751,7 +2752,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx)
27512752
dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite);
27522753
mutex_exit(&db->db_mtx);
27532754
} else if (db->db_state == DB_NOFILL) {
2754-
ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF);
2755+
ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF ||
2756+
zp.zp_checksum == ZIO_CHECKSUM_NOPARITY);
27552757
dr->dr_zio = zio_write(zio, os->os_spa, txg,
27562758
db->db_blkptr, NULL, db->db.db_size, &zp,
27572759
dbuf_write_nofill_ready, dbuf_write_nofill_done, db,

usr/src/uts/common/fs/zfs/dmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2323
* Copyright (c) 2013 by Delphix. All rights reserved.
2424
*/
25-
2625
/* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */
26+
/* Copyright (c) 2013, Joyent, Inc. All rights reserved. */
2727

2828
#include <sys/dmu.h>
2929
#include <sys/dmu_impl.h>
@@ -1597,7 +1597,7 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
15971597
* pipeline.
15981598
*/
15991599
compress = ZIO_COMPRESS_OFF;
1600-
checksum = ZIO_CHECKSUM_OFF;
1600+
checksum = ZIO_CHECKSUM_NOPARITY;
16011601
} else {
16021602
compress = zio_compress_select(dn->dn_compress, compress);
16031603

usr/src/uts/common/fs/zfs/sys/vdev_disk.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
/*
2222
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2323
* Use is subject to license terms.
24+
* Copyright (c) 2013 Joyent, Inc. All rights reserved.
2425
*/
2526

2627
#ifndef _SYS_VDEV_DISK_H
2728
#define _SYS_VDEV_DISK_H
2829

29-
#pragma ident "%Z%%M% %I% %E% SMI"
30-
3130
#include <sys/vdev.h>
3231
#ifdef _KERNEL
3332
#include <sys/buf.h>
@@ -40,14 +39,23 @@
4039
extern "C" {
4140
#endif
4241

42+
#ifdef _KERNEL
4343
typedef struct vdev_disk {
4444
ddi_devid_t vd_devid;
4545
char *vd_minor;
4646
ldi_handle_t vd_lh;
4747
} vdev_disk_t;
48+
#endif
4849

50+
extern int vdev_disk_physio(vdev_t *,
51+
caddr_t, size_t, uint64_t, int, boolean_t);
52+
53+
/*
54+
* Since vdev_disk.c is not compiled into libzpool, this function should only be
55+
* defined in the zfs kernel module.
56+
*/
4957
#ifdef _KERNEL
50-
extern int vdev_disk_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int);
58+
extern int vdev_disk_ldi_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int);
5159
#endif
5260
#ifdef __cplusplus
5361
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* CDDL HEADER START
3+
*
4+
* The contents of this file are subject to the terms of the
5+
* Common Development and Distribution License (the "License").
6+
* You may not use this file except in compliance with the License.
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+
/*
22+
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
23+
*/
24+
25+
#ifndef _SYS_VDEV_RAIDZ_H
26+
#define _SYS_VDEV_RAIDZ_H
27+
28+
#include <sys/vdev.h>
29+
#include <sys/semaphore.h>
30+
#ifdef _KERNEL
31+
#include <sys/ddi.h>
32+
#include <sys/sunldi.h>
33+
#include <sys/sunddi.h>
34+
#endif
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
#ifdef _KERNEL
41+
extern int vdev_raidz_physio(vdev_t *,
42+
caddr_t, size_t, uint64_t, uint64_t, boolean_t, boolean_t);
43+
#endif
44+
#ifdef __cplusplus
45+
}
46+
#endif
47+
48+
#endif /* _SYS_VDEV_RAIDZ_H */

0 commit comments

Comments
 (0)