From 5dc9a9865ba3fe32b5a92dcdbc8fbdcdaa98f54f Mon Sep 17 00:00:00 2001 From: David Zhang Date: Wed, 11 Nov 2009 10:47:43 +0800 Subject: 6878294 FMA is too aggressive in marking the disk as faulty for zfs relocated the fatal read media error 6895028 libtopo does not work on Netra-X4200-M2 platform 6892864 setserdsuffix() should work with integer type --- usr/src/cmd/fm/eversholt/files/common/disk.esc | 40 +++++++++++-- usr/src/cmd/fm/modules/common/eversholt/eval.c | 12 ++++ usr/src/lib/fm/topo/maps/Makefile | 1 + .../lib/fm/topo/maps/SUNW,Netra-X4200-M2/Makefile | 40 +++++++++++++ .../Netra-X4200-M2-disk-hc-topology.xmlgen | 69 ++++++++++++++++++++++ .../topo/maps/i86pc/i86pc-legacy-hc-topology.xml | 11 +++- usr/src/pkgdefs/SUNWfmd/prototype_i386 | 1 + 7 files changed, 168 insertions(+), 6 deletions(-) create mode 100644 usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Makefile create mode 100644 usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Netra-X4200-M2-disk-hc-topology.xmlgen (limited to 'usr/src') diff --git a/usr/src/cmd/fm/eversholt/files/common/disk.esc b/usr/src/cmd/fm/eversholt/files/common/disk.esc index 823c605690..ce2a1d8854 100644 --- a/usr/src/cmd/fm/eversholt/files/common/disk.esc +++ b/usr/src/cmd/fm/eversholt/files/common/disk.esc @@ -19,27 +19,43 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma dictionary "DISK" -#define P disk +#define P disk fru P; asru P; /* - * disk-as-detector: The disk-as-detector DE provides the mapping between + * Over all comments for this file: + * The disk-as-detector DE provides the mapping between * ereports generated by a kernel disk driver sd(7D) and resulting faults. */ +/* + * SERD engine for media error fault propagation: + * + * This strategy is designed to give a file system, like ZFS, the + * ability to attempt data recovery/relocation without faulting a disk. + * This implementation depends on a file system retry to the same lba + * to trigger a fault when recovery/relocation is not possible. + * + * We let the engine propagate one error only once every 1 minute and then if we + * still get 2 or more * errors within 24 hours for the same LBA, there is a fault. + */ +engine serd.io.scsi.cmd.disk.dev.rqs.merr@P, N=1, T=24h; + /* * disk-as-detector: fault events. */ event fault.io.scsi.cmd.disk.dev.rqs.derr@P; -event fault.io.scsi.cmd.disk.dev.rqs.merr@P; +event fault.io.scsi.cmd.disk.dev.rqs.merr@P, + engine=serd.io.scsi.cmd.disk.dev.rqs.merr@P; + /* * The uderr fault will be defined at some future time. * event fault.io.scsi.cmd.disk.dev.uderr@P; @@ -96,13 +112,29 @@ prop fault.io.scsi.cmd.disk.dev.rqs.derr@P-> setpayloadprop("asc", payloadprop("asc")) && setpayloadprop("ascq", payloadprop("ascq"))}; +/* + * Utilize setserdsuffix with specific LBA, + * the serd engine would only trigger if the fault recurred on the same LBA + */ prop fault.io.scsi.cmd.disk.dev.rqs.merr@P-> ereport.io.scsi.cmd.disk.dev.rqs.merr@P{ DRIVER_ASSESSMENT_FATAL && + setserdsuffix(payloadprop("lba")) && setpayloadprop("key", payloadprop("key")) && setpayloadprop("asc", payloadprop("asc")) && setpayloadprop("ascq", payloadprop("ascq")) && setpayloadprop("lba", payloadprop("lba"))}; +/* + * NOTE: this propagation uses the "may" propagation of eversholt. + * The ereport need never exist. It's just a way of making + * the diagnosis wait for the within time on that ereport + * to complete. Once it has completed the diagnosis continues + * even though the dummy ereport didn't occur. + */ +event ereport.io.scsi.cmd.disk.dev.rqs.merr.dummy@P {within(60s)}; +prop fault.io.scsi.cmd.disk.dev.rqs.merr@P (0) -> + ereport.io.scsi.cmd.disk.dev.rqs.merr.dummy@P; + /* * The uderr fault will be propagated at some future time. * prop fault.io.scsi.cmd.disk.dev.uderr@P-> diff --git a/usr/src/cmd/fm/modules/common/eversholt/eval.c b/usr/src/cmd/fm/modules/common/eversholt/eval.c index f7bd53227c..54b24f8513 100644 --- a/usr/src/cmd/fm/modules/common/eversholt/eval.c +++ b/usr/src/cmd/fm/modules/common/eversholt/eval.c @@ -649,6 +649,18 @@ eval_func(struct node *funcnp, struct lut *ex, struct node *events[], serdvalp->v = (uintptr_t)stable(buf); FREE(buf); } + if (funcname == L_setserdsuffix && + serdvalp->t == UINT64) { + int len = snprintf(NULL, 0, "%lld", + serdvalp->v); + char *buf = MALLOC(len + 1); + + (void) snprintf(buf, len + 1, "%lld", + serdvalp->v); + serdvalp->t = STRING; + serdvalp->v = (uintptr_t)stable(buf); + FREE(buf); + } if (serdvalp->t == UINT64) out(O_ALTFP|O_VERB2, " (%llu)", serdvalp->v); diff --git a/usr/src/lib/fm/topo/maps/Makefile b/usr/src/lib/fm/topo/maps/Makefile index c22647c404..de6d9f5e0f 100644 --- a/usr/src/lib/fm/topo/maps/Makefile +++ b/usr/src/lib/fm/topo/maps/Makefile @@ -45,6 +45,7 @@ i386_SUBDIRS = i86pc \ i386 \ SUNW,Sun-Fire-X4200-Server \ SUNW,Sun-Fire-X4200-M2 \ + SUNW,Netra-X4200-M2 \ SUNW,Sun-Fire-X4500 \ SUNW,Sun-Fire-X4540 \ SUNW,Sun-Fire-X4600-M2 diff --git a/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Makefile b/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Makefile new file mode 100644 index 0000000000..1a84db38f4 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Makefile @@ -0,0 +1,40 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# NOTE: The name of the xml file we are building is 'platform' +# specific, but its build is structured as 'arch' specific since +# 'uname -i' on all x86 platforms returns i86pc. + +ARCH = i86pc +CLASS = arch +DTDFILE = topology.dtd.1 +TOPOFILE = Netra-X4200-M2-disk-hc-topology.xml +SRCDIR = ../SUNW,Netra-X4200-M2 + +PLATFORM = Netra-X4200-M2 +TOPOBASE = ../i86pc/i86pc-hc-topology.xml + +include ../Makefile.map diff --git a/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Netra-X4200-M2-disk-hc-topology.xmlgen b/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Netra-X4200-M2-disk-hc-topology.xmlgen new file mode 100644 index 0000000000..90d37aac60 --- /dev/null +++ b/usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Netra-X4200-M2-disk-hc-topology.xmlgen @@ -0,0 +1,69 @@ +#!/usr/local/bin/perl +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +$num_bays = 4; +$bay_label = "HD"; + +print < + +EOF + +$controller = 0; +for ($bay = 0; $bay < $num_bays; $bay++) { + $hpath = "/pci\@79,0/pci1022,7458\@11/pci1000,3060\@2"; + $tpath = sprintf("/sd\@%x,0", $bay); + $apoint = sprintf(":scsi::dsk/c%dt%dd0", + $controller + 1, $bay); + + print < + + + + + + + + + + +EOF +} + +print < + + + + + + +EOF diff --git a/usr/src/lib/fm/topo/maps/i86pc/i86pc-legacy-hc-topology.xml b/usr/src/lib/fm/topo/maps/i86pc/i86pc-legacy-hc-topology.xml index d6ef9b2e07..00b771f66d 100644 --- a/usr/src/lib/fm/topo/maps/i86pc/i86pc-legacy-hc-topology.xml +++ b/usr/src/lib/fm/topo/maps/i86pc/i86pc-legacy-hc-topology.xml @@ -34,7 +34,8 @@ - + @@ -86,7 +87,8 @@ - + @@ -104,6 +106,11 @@ + + + + + diff --git a/usr/src/pkgdefs/SUNWfmd/prototype_i386 b/usr/src/pkgdefs/SUNWfmd/prototype_i386 index 764a92f156..6acf321c3f 100644 --- a/usr/src/pkgdefs/SUNWfmd/prototype_i386 +++ b/usr/src/pkgdefs/SUNWfmd/prototype_i386 @@ -92,6 +92,7 @@ f none usr/platform/i86pc/lib/fm/topo/maps/i86pc-legacy-hc-topology.xml 444 root f none usr/platform/i86pc/lib/fm/topo/maps/psu-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/Sun-Fire-X4200-M2-disk-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/Sun-Fire-X4200-Server-disk-hc-topology.xml 444 root bin +f none usr/platform/i86pc/lib/fm/topo/maps/Netra-X4200-M2-disk-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/Sun-Fire-X4500-disk-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/Sun-Fire-X4540-disk-hc-topology.xml 444 root bin f none usr/platform/i86pc/lib/fm/topo/maps/Sun-Fire-X4600-M2-disk-hc-topology.xml 444 root bin -- cgit v1.2.3