linux/drivers/md
NeilBrown de393cdea6 md: make it easier to wait for bad blocks to be acknowledged.
It is only safe to choose not to write to a bad block if that bad
block is safely recorded in metadata - i.e. if it has been
'acknowledged'.

If it hasn't we need to wait for the acknowledgement.

We support that using rdev->blocked wait and
md_wait_for_blocked_rdev by introducing a new device flag
'BlockedBadBlock'.

This flag is only advisory.
It is cleared whenever we acknowledge a bad block, so that a waiter
can re-check the particular bad blocks that it is interested it.

It should be set by a caller when they find they need to wait.
This (set after test) is inherently racy, but as
md_wait_for_blocked_rdev already has a timeout, losing the race will
have minimal impact.

When we clear "Blocked" was also clear "BlockedBadBlocks" incase it
was set incorrectly (see above race).

We also modify the way we manage 'Blocked' to fit better with the new
handling of 'BlockedBadBlocks' and to make it consistent between
externally managed and internally managed metadata.   This requires
that each raidXd loop checks if the metadata needs to be written and
triggers a write (md_check_recovery) if needed.  Otherwise a queued
write request might cause raidXd to wait for the metadata to write,
and only that thread can write it.

Before writing metadata, we set FaultRecorded for all devices that
are Faulty, then after writing the metadata we clear Blocked for any
device for which the Fault was certainly Recorded.

The 'faulty' device flag now appears in sysfs if the device is faulty
*or* it has unacknowledged bad blocks.  So user-space which does not
understand bad blocks can continue to function correctly.
User space which does, should not assume a device is faulty until it
sees the 'faulty' flag, and then sees the list of unacknowledged bad
blocks is empty.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-28 11:31:48 +10:00
..
Kconfig dm: add flakey target 2011-03-24 13:54:24 +00:00
Makefile dm: add flakey target 2011-03-24 13:54:24 +00:00
bitmap.c MD bitmap: Revert DM dirty log hooks 2011-07-27 11:00:37 +10:00
bitmap.h MD bitmap: Revert DM dirty log hooks 2011-07-27 11:00:37 +10:00
dm-bio-record.h
dm-crypt.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm 2011-03-25 20:51:44 -07:00
dm-delay.c dm: convert workqueues to alloc_ordered 2011-01-13 19:59:57 +00:00
dm-exception-store.c dm snapshot: test chunk size against both origin and snapshot 2010-08-12 04:13:51 +01:00
dm-exception-store.h dm snapshot: test chunk size against both origin and snapshot 2010-08-12 04:13:51 +01:00
dm-flakey.c dm: add flakey target 2011-03-24 13:54:24 +00:00
dm-io.c dm io: use fixed initial mempool size 2011-05-29 13:03:09 +01:00
dm-ioctl.c dm ioctl: add flag to wipe buffers for secure data 2011-03-24 13:54:30 +00:00
dm-kcopyd.c dm kcopyd: return client directly and not through a pointer 2011-05-29 13:03:13 +01:00
dm-linear.c dm: use dm_target_offset macro 2010-08-12 04:14:11 +01:00
dm-log-userspace-base.c dm log userspace: add version number to comms 2011-01-13 19:59:52 +00:00
dm-log-userspace-transfer.c netlink: kill eff_cap from struct netlink_skb_parms 2011-03-03 13:32:07 -08:00
dm-log-userspace-transfer.h
dm-log.c dm io: use fixed initial mempool size 2011-05-29 13:03:09 +01:00
dm-mpath.c dm mpath: do not fail paths after integrity errors 2011-05-29 13:02:55 +01:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-queue-length.c
dm-raid.c md/dm - remove remains of plug_fn callback. 2011-04-18 18:25:41 +10:00
dm-raid1.c dm kcopyd: return client directly and not through a pointer 2011-05-29 13:03:13 +01:00
dm-region-hash.c Fix common misspellings 2011-03-31 11:26:23 -03:00
dm-round-robin.c
dm-service-time.c
dm-snap-persistent.c dm io: use fixed initial mempool size 2011-05-29 13:03:09 +01:00
dm-snap-transient.c
dm-snap.c dm kcopyd: return client directly and not through a pointer 2011-05-29 13:03:13 +01:00
dm-stripe.c dm stripe: implement merge method 2011-03-24 13:54:35 +00:00
dm-sysfs.c
dm-table.c dm table: reject devices without request fns 2011-05-29 13:02:52 +01:00
dm-target.c dm: error return error for discards 2010-08-12 04:14:14 +01:00
dm-uevent.c
dm-uevent.h
dm-zero.c dm: zero silently drop discards 2010-08-12 04:14:12 +01:00
dm.c block: fix non-atomic access to genhd inflight structures 2011-03-22 08:35:35 +01:00
dm.h block: Require subsystems to explicitly allocate bio_set integrity mempool 2011-03-17 11:11:05 +01:00
faulty.c Fix common misspellings 2011-03-31 11:26:23 -03:00
linear.c block: Require subsystems to explicitly allocate bio_set integrity mempool 2011-03-17 11:11:05 +01:00
linear.h
md.c md: make it easier to wait for bad blocks to be acknowledged. 2011-07-28 11:31:48 +10:00
md.h md: make it easier to wait for bad blocks to be acknowledged. 2011-07-28 11:31:48 +10:00
multipath.c md: make error_handler functions more uniform and correct. 2011-05-11 14:38:44 +10:00
multipath.h md/multipath: discard ->working_disks in favour of ->degraded 2011-05-11 14:38:02 +10:00
raid0.c block: Require subsystems to explicitly allocate bio_set integrity mempool 2011-03-17 11:11:05 +01:00
raid0.h
raid1.c md: make it easier to wait for bad blocks to be acknowledged. 2011-07-28 11:31:48 +10:00
raid1.h md/raid1: avoid reading from known bad blocks. 2011-07-28 11:31:48 +10:00
raid5.c md: make it easier to wait for bad blocks to be acknowledged. 2011-07-28 11:31:48 +10:00
raid5.h md/raid5: add some more fields to stripe_head_state 2011-07-26 11:35:20 +10:00
raid10.c md: make it easier to wait for bad blocks to be acknowledged. 2011-07-28 11:31:48 +10:00
raid10.h md/raid10: Make use of new recovery_disabled handling 2011-07-27 11:00:36 +10:00