X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fzinject%2Ftranslate.c;h=fc1612738e111f8e8df2b357101df68963522291;hb=cc92e9d0c3e67a7e66c844466f85696a087bf60a;hp=160786641e4e164a82070e14f189c5cb46fcbc38;hpb=57f5a2008e2e6acf58934cf43c5fdca0faffa73e;p=zfs.git diff --git a/cmd/zinject/translate.c b/cmd/zinject/translate.c index 1607866..fc16127 100644 --- a/cmd/zinject/translate.c +++ b/cmd/zinject/translate.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -476,6 +477,20 @@ translate_device(const char *pool, const char *device, err_type_t label_type, &record->zi_guid) == 0); } + /* + * Device faults can take on three different forms: + * 1). delayed or hanging I/O + * 2). zfs label faults + * 3). generic disk faults + */ + if (record->zi_timer != 0) { + record->zi_cmd = ZINJECT_DELAY_IO; + } else if (label_type != TYPE_INVAL) { + record->zi_cmd = ZINJECT_LABEL_FAULT; + } else { + record->zi_cmd = ZINJECT_DEVICE_FAULT; + } + switch (label_type) { default: break;