diff options
author | trociny <trociny@FreeBSD.org> | 2013-02-25 20:09:07 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2013-02-25 20:09:07 +0000 |
commit | 8690e69f6a4dba617b6c0fadf7cb2139a60500b8 (patch) | |
tree | 7c3a030feb23f647bd2528a4d8e72a4d5621913d /sbin/hastd/secondary.c | |
parent | 1f658c88bed0f72839a6caee6fdc9731cfd3a516 (diff) | |
download | FreeBSD-src-8690e69f6a4dba617b6c0fadf7cb2139a60500b8.zip FreeBSD-src-8690e69f6a4dba617b6c0fadf7cb2139a60500b8.tar.gz |
Add i/o error counters to hastd(8) and make hastctl(8) display
them. This may be useful for detecting problems with HAST disks.
Discussed with and reviewed by: pjd
MFC after: 1 week
Diffstat (limited to 'sbin/hastd/secondary.c')
-rw-r--r-- | sbin/hastd/secondary.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c index 71524e9..febdc05 100644 --- a/sbin/hastd/secondary.c +++ b/sbin/hastd/secondary.c @@ -765,6 +765,7 @@ disk_thread(void *arg) pjdlog_errno(LOG_WARNING, "Unable to store cleared activemap"); free(map); + res->hr_stat_activemap_write_error++; break; } free(map); @@ -883,8 +884,23 @@ send_thread(void *arg) PJDLOG_ABORT("Unexpected command (cmd=%hhu).", hio->hio_cmd); } - if (hio->hio_error != 0) + if (hio->hio_error != 0) { + switch (hio->hio_cmd) { + case HIO_READ: + res->hr_stat_read_error++; + break; + case HIO_WRITE: + res->hr_stat_write_error++; + break; + case HIO_DELETE: + res->hr_stat_delete_error++; + break; + case HIO_FLUSH: + res->hr_stat_flush_error++; + break; + } nv_add_int16(nvout, hio->hio_error, "error"); + } if (hast_proto_send(res, res->hr_remoteout, nvout, data, length) == -1) { secondary_exit(EX_TEMPFAIL, "Unable to send reply"); |