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/primary.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/primary.c')
-rw-r--r-- | sbin/hastd/primary.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c index fb49ef6..a9dfa2b 100644 --- a/sbin/hastd/primary.c +++ b/sbin/hastd/primary.c @@ -303,6 +303,7 @@ hast_activemap_flush(struct hast_resource *res) if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); + res->hr_stat_activemap_write_error++; return (-1); } if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { @@ -313,6 +314,7 @@ hast_activemap_flush(struct hast_resource *res) } else { pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); + res->hr_stat_activemap_flush_error++; return (-1); } } @@ -1936,6 +1938,22 @@ ggate_send_thread(void *arg) "G_GATE_CMD_DONE failed"); } } + if (hio->hio_errors[0]) { + switch (ggio->gctl_cmd) { + case BIO_READ: + res->hr_stat_read_error++; + break; + case BIO_WRITE: + res->hr_stat_write_error++; + break; + case BIO_DELETE: + res->hr_stat_delete_error++; + break; + case BIO_FLUSH: + res->hr_stat_flush_error++; + break; + } + } pjdlog_debug(2, "ggate_send: (%p) Moving request to the free queue.", hio); QUEUE_INSERT2(hio, free); |