linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Btrfs: add IO error device stats
@ 2012-05-22 10:53 Stefan Behrens
  2012-05-22 10:53 ` [PATCH v4 1/3] Btrfs: add device counters for detected IO and checksum errors Stefan Behrens
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Behrens @ 2012-05-22 10:53 UTC (permalink / raw)
  To: linux-btrfs

Changes v1-v2:
- Remove restriction that BTRFS_IOC_GET_DEVICE_STATS is a privileged
  operation
- Cast u64 to unsigned long long for printf()

Changes v2-v3:
- Rebased on Chris' current master

Changes v3-v4:
- Add padding at end of ioctl structure

The goal is to detect when drives start to get an increased error rate,
when drives should be replaced soon. Therefore statistic counters are
added that count IO errors (read, write and flush). Additionally, the
software detected errors like checksum errors and corrupted blocks are
counted.

An ioctl interface is added to get the device statistic counters.
A second ioctl is added to atomically get and reset these counters.

The device statistics are written into the device tree with each
transaction commit. Only modified statistics are written.
When a filesystem is mounted, the device statistics for each involved
device are read from the device tree and used to initialize the
counters.

A patch for the btrfs-progs world will also be sent.

Stefan Behrens (3):
  Btrfs: add device counters for detected IO and checksum errors
  Btrfs: add ioctl to get and reset the device stats
  Btrfs: read device stats on mount, write modified ones during commit

 fs/btrfs/ctree.h       |   51 ++++++++
 fs/btrfs/disk-io.c     |   25 +++-
 fs/btrfs/extent_io.c   |   27 +++-
 fs/btrfs/ioctl.c       |   26 ++++
 fs/btrfs/ioctl.h       |   28 ++++
 fs/btrfs/print-tree.c  |    3 +
 fs/btrfs/scrub.c       |   72 ++++++++---
 fs/btrfs/transaction.c |    4 +
 fs/btrfs/volumes.c     |  335 +++++++++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/volumes.h     |   43 +++++++
 10 files changed, 589 insertions(+), 25 deletions(-)

-- 
1.7.10.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-23 14:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-22 10:53 [PATCH v4 0/3] Btrfs: add IO error device stats Stefan Behrens
2012-05-22 10:53 ` [PATCH v4 1/3] Btrfs: add device counters for detected IO and checksum errors Stefan Behrens
2012-05-23 14:00   ` David Sterba
2012-05-22 10:53 ` [PATCH v4 2/3] Btrfs: add ioctl to get and reset the device stats Stefan Behrens
2012-05-23 14:32   ` David Sterba
2012-05-22 10:53 ` [PATCH v4 3/3] Btrfs: read device stats on mount, write modified ones during commit Stefan Behrens
2012-05-23  1:29   ` Liu Bo
2012-05-23 14:48     ` Stefan Behrens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).