aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:31:49 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:31:49 -0400
commit4367af556133723d0f443e14ca8170d9447317cb (patch)
treed87bb40920f0f43cea586b7dd99b45f713ffd614 /drivers/md/raid1.h
parent1f68f0c4b677ccd6935ff61e4e6888787505f8dc (diff)
md/raid1: clear bad-block record when write succeeds.
If we succeed in writing to a block that was recorded as being bad, we clear the bad-block record. This requires some delayed handling as the bad-block-list update has to happen in process-context. Signed-off-by: NeilBrown <neilb@suse.de> Reviewed-by: Namhyung Kim <namhyung@gmail.com>
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r--drivers/md/raid1.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index aa6af37ca01b..f81360d49af4 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -116,7 +116,14 @@ struct r1bio_s {
116 * correct the read error. To keep track of bad blocks on a per-bio 116 * correct the read error. To keep track of bad blocks on a per-bio
117 * level, we store IO_BLOCKED in the appropriate 'bios' pointer 117 * level, we store IO_BLOCKED in the appropriate 'bios' pointer
118 */ 118 */
119#define IO_BLOCKED ((struct bio*)1) 119#define IO_BLOCKED ((struct bio *)1)
120/* When we successfully write to a known bad-block, we need to remove the
121 * bad-block marking which must be done from process context. So we record
122 * the success by setting bios[n] to IO_MADE_GOOD
123 */
124#define IO_MADE_GOOD ((struct bio *)2)
125
126#define BIO_SPECIAL(bio) ((unsigned long)bio <= 2)
120 127
121/* bits for r1bio.state */ 128/* bits for r1bio.state */
122#define R1BIO_Uptodate 0 129#define R1BIO_Uptodate 0
@@ -135,6 +142,10 @@ struct r1bio_s {
135 * Record that bi_end_io was called with this flag... 142 * Record that bi_end_io was called with this flag...
136 */ 143 */
137#define R1BIO_Returned 6 144#define R1BIO_Returned 6
145/* If a write for this request means we can clear some
146 * known-bad-block records, we set this flag
147 */
148#define R1BIO_MadeGood 7
138 149
139extern int md_raid1_congested(mddev_t *mddev, int bits); 150extern int md_raid1_congested(mddev_t *mddev, int bits);
140 151