* [PATCH md 000 of 7] Introduction
@ 2005-08-02 9:53 NeilBrown
2005-08-02 9:53 ` [PATCH md 004 of 7] Fail IO request to md that require a barrier NeilBrown
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
Following are 7 patches for md in 2.6.13-rc4
They are all fairly well tested, with the possible exception of '4' -
I haven't actually tried throwing BIO_RW_BARRIER requests are any md
devices. However the code is very straight forward.
I'm happy (even keen) for these to go into 2.6.13.
If it's getting a bit late, then 2 is probably the most important.
The others we can probably live without.
Thanks,
NeilBrown
[PATCH md 001 of 7] Remove a stray debugging printk.
[PATCH md 002 of 7] Make 'md' and alias for 'md-mod'
[PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation.
[PATCH md 004 of 7] Fail IO requests to md that require a barrier.
[PATCH md 005 of 7] Always honour md bitmap being read from disk
[PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases...
[PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 005 of 7] Always honour md bitmap being read from disk
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
2005-08-02 9:53 ` [PATCH md 004 of 7] Fail IO request to md that require a barrier NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 002 of 7] Make 'md' and alias for 'md-mod' NeilBrown
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
The code currently will ignore the bitmap if the array seem to be
in-sync. This is wrong if the array is degraded, and probably wrong anyway.
If the bitmap says some chunks are not in in-sync, and the superblock says
everything IS in sync, then something is clearly wrong, and it is safer
to trust the bitmap.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/bitmap.c | 52 ++++++++++++++++++++++----------------------------
1 files changed, 23 insertions(+), 29 deletions(-)
diff ./drivers/md/bitmap.c~current~ ./drivers/md/bitmap.c
--- ./drivers/md/bitmap.c~current~ 2005-08-02 15:23:11.000000000 +1000
+++ ./drivers/md/bitmap.c 2005-08-02 15:23:11.000000000 +1000
@@ -817,8 +817,7 @@ int bitmap_unplug(struct bitmap *bitmap)
return 0;
}
-static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset,
- unsigned long sectors, int in_sync);
+static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset);
/* * bitmap_init_from_disk -- called at bitmap_create time to initialize
* the in-memory bitmap from the on-disk bitmap -- also, sets up the
* memory mapping of the bitmap file
@@ -827,7 +826,7 @@ static void bitmap_set_memory_bits(struc
* previously kicked from the array, we mark all the bits as
* 1's in order to cause a full resync.
*/
-static int bitmap_init_from_disk(struct bitmap *bitmap, int in_sync)
+static int bitmap_init_from_disk(struct bitmap *bitmap)
{
unsigned long i, chunks, index, oldindex, bit;
struct page *page = NULL, *oldpage = NULL;
@@ -928,8 +927,7 @@ static int bitmap_init_from_disk(struct
}
if (test_bit(bit, page_address(page))) {
/* if the disk bit is set, set the memory bit */
- bitmap_set_memory_bits(bitmap,
- i << CHUNK_BLOCK_SHIFT(bitmap), 1, in_sync);
+ bitmap_set_memory_bits(bitmap, i << CHUNK_BLOCK_SHIFT(bitmap));
bit_cnt++;
}
}
@@ -1425,35 +1423,30 @@ void bitmap_close_sync(struct bitmap *bi
}
}
-static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset,
- unsigned long sectors, int in_sync)
+static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset)
{
/* For each chunk covered by any of these sectors, set the
- * counter to 1 and set resync_needed unless in_sync. They should all
+ * counter to 1 and set resync_needed. They should all
* be 0 at this point
*/
- while (sectors) {
- int secs;
- bitmap_counter_t *bmc;
- spin_lock_irq(&bitmap->lock);
- bmc = bitmap_get_counter(bitmap, offset, &secs, 1);
- if (!bmc) {
- spin_unlock_irq(&bitmap->lock);
- return;
- }
- if (! *bmc) {
- struct page *page;
- *bmc = 1 | (in_sync? 0 : NEEDED_MASK);
- bitmap_count_page(bitmap, offset, 1);
- page = filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap));
- set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
- }
+
+ int secs;
+ bitmap_counter_t *bmc;
+ spin_lock_irq(&bitmap->lock);
+ bmc = bitmap_get_counter(bitmap, offset, &secs, 1);
+ if (!bmc) {
spin_unlock_irq(&bitmap->lock);
- if (sectors > secs)
- sectors -= secs;
- else
- sectors = 0;
+ return;
}
+ if (! *bmc) {
+ struct page *page;
+ *bmc = 1 | NEEDED_MASK;
+ bitmap_count_page(bitmap, offset, 1);
+ page = filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap));
+ set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
+ }
+ spin_unlock_irq(&bitmap->lock);
+
}
/*
@@ -1564,7 +1557,8 @@ int bitmap_create(mddev_t *mddev)
/* now that we have some pages available, initialize the in-memory
* bitmap from the on-disk bitmap */
- err = bitmap_init_from_disk(bitmap, mddev->recovery_cp == MaxSector);
+ err = bitmap_init_from_disk(bitmap);
+
if (err)
return err;
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 001 of 7] Remove a stray debugging printk.
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
` (4 preceding siblings ...)
2005-08-02 9:53 ` [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped NeilBrown
2005-08-04 5:10 ` [PATCH md 000 of 7] Introduction Andrew Morton
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/md.c | 1 -
1 files changed, 1 deletion(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2005-08-02 15:22:11.000000000 +1000
+++ ./drivers/md/md.c 2005-08-02 15:22:11.000000000 +1000
@@ -3484,7 +3484,6 @@ static void md_do_sync(mddev_t *mddev)
goto skip;
}
ITERATE_MDDEV(mddev2,tmp) {
- printk(".");
if (mddev2 == mddev)
continue;
if (mddev2->curr_resync &&
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases...
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
` (2 preceding siblings ...)
2005-08-02 9:53 ` [PATCH md 002 of 7] Make 'md' and alias for 'md-mod' NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation NeilBrown
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
Firstly, R1BIO_Degraded was being set in a number of places in the
resync code, but is never used there, so get rid of those settings.
Then: When doing a resync, we want to clear the bit in the bitmap iff
the array will be non-degraded when the sync has completed. However
the current code would clear the bitmap if the array was non-degraded
when the resync *started*, which obviously isn't right (it is for
'resync' but not for 'recovery' - i.e. rebuilding a failed drive).
This patch calculated 'still_degraded' and uses the to tell
bitmap_start_sync whether this sync should clear the corresponding
bit.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/raid1.c | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
diff ./drivers/md/raid1.c~current~ ./drivers/md/raid1.c
--- ./drivers/md/raid1.c~current~ 2005-08-02 15:23:02.000000000 +1000
+++ ./drivers/md/raid1.c 2005-08-02 15:23:16.000000000 +1000
@@ -897,7 +897,6 @@ static int end_sync_read(struct bio *bio
if (!uptodate) {
md_error(r1_bio->mddev,
conf->mirrors[r1_bio->read_disk].rdev);
- set_bit(R1BIO_Degraded, &r1_bio->state);
} else
set_bit(R1BIO_Uptodate, &r1_bio->state);
rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev);
@@ -922,10 +921,9 @@ static int end_sync_write(struct bio *bi
mirror = i;
break;
}
- if (!uptodate) {
+ if (!uptodate)
md_error(mddev, conf->mirrors[mirror].rdev);
- set_bit(R1BIO_Degraded, &r1_bio->state);
- }
+
update_head_pos(mirror, r1_bio);
if (atomic_dec_and_test(&r1_bio->remaining)) {
@@ -1113,6 +1111,7 @@ static sector_t sync_request(mddev_t *md
int i;
int write_targets = 0;
int sync_blocks;
+ int still_degraded = 0;
if (!conf->r1buf_pool)
{
@@ -1141,7 +1140,10 @@ static sector_t sync_request(mddev_t *md
return 0;
}
- if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, mddev->degraded) &&
+ /* before building a request, check if we can skip these blocks..
+ * This call the bitmap_start_sync doesn't actually record anything
+ */
+ if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
!conf->fullsync) {
/* We can skip this block, and probably several more */
*skipped = 1;
@@ -1207,24 +1209,23 @@ static sector_t sync_request(mddev_t *md
if (i == disk) {
bio->bi_rw = READ;
bio->bi_end_io = end_sync_read;
- } else if (conf->mirrors[i].rdev &&
- !conf->mirrors[i].rdev->faulty &&
- (!conf->mirrors[i].rdev->in_sync ||
- sector_nr + RESYNC_SECTORS > mddev->recovery_cp)) {
+ } else if (conf->mirrors[i].rdev == NULL ||
+ conf->mirrors[i].rdev->faulty) {
+ still_degraded = 1;
+ continue;
+ } else if (!conf->mirrors[i].rdev->in_sync ||
+ sector_nr + RESYNC_SECTORS > mddev->recovery_cp) {
bio->bi_rw = WRITE;
bio->bi_end_io = end_sync_write;
write_targets ++;
} else
+ /* no need to read or write here */
continue;
bio->bi_sector = sector_nr + conf->mirrors[i].rdev->data_offset;
bio->bi_bdev = conf->mirrors[i].rdev->bdev;
bio->bi_private = r1_bio;
}
- if (write_targets + 1 < conf->raid_disks)
- /* array degraded, can't clear bitmap */
- set_bit(R1BIO_Degraded, &r1_bio->state);
-
if (write_targets == 0) {
/* There is nowhere to write, so all non-sync
* drives must be failed - so we are finished
@@ -1247,7 +1248,7 @@ static sector_t sync_request(mddev_t *md
break;
if (sync_blocks == 0) {
if (!bitmap_start_sync(mddev->bitmap, sector_nr,
- &sync_blocks, mddev->degraded) &&
+ &sync_blocks, still_degraded) &&
!conf->fullsync)
break;
if (sync_blocks < (PAGE_SIZE>>9))
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation.
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
` (3 preceding siblings ...)
2005-08-02 9:53 ` [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 001 of 7] Remove a stray debugging printk NeilBrown
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
'this_sector' is a virtual (array) address while 'head_position' is
a physical (device) address, so substraction doesn't make any sense.
devs[slot].addr should be used instead of this_sector.
However, this patch doesn't make much practical different to the read
balancing due to the effects of later code.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/raid10.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff ./drivers/md/raid10.c~current~ ./drivers/md/raid10.c
--- ./drivers/md/raid10.c~current~ 2005-08-02 15:22:31.000000000 +1000
+++ ./drivers/md/raid10.c 2005-08-02 15:22:31.000000000 +1000
@@ -538,7 +538,8 @@ static int read_balance(conf_t *conf, r1
}
- current_distance = abs(this_sector - conf->mirrors[disk].head_position);
+ current_distance = abs(r10_bio->devs[slot].addr -
+ conf->mirrors[disk].head_position);
/* Find the disk whose head is closest */
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 004 of 7] Fail IO request to md that require a barrier.
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 005 of 7] Always honour md bitmap being read from disk NeilBrown
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
md does not yet support BIO_RW_BARRIER, so be honest about it
and fail (-EOPNOTSUPP) any such requests.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/linear.c | 5 +++++
./drivers/md/multipath.c | 5 +++++
./drivers/md/raid0.c | 5 +++++
./drivers/md/raid1.c | 4 ++++
./drivers/md/raid10.c | 5 +++++
./drivers/md/raid5.c | 5 +++++
./drivers/md/raid6main.c | 5 +++++
7 files changed, 34 insertions(+)
diff ./drivers/md/linear.c~current~ ./drivers/md/linear.c
--- ./drivers/md/linear.c~current~ 2005-08-02 15:23:02.000000000 +1000
+++ ./drivers/md/linear.c 2005-08-02 15:23:02.000000000 +1000
@@ -238,6 +238,11 @@ static int linear_make_request (request_
dev_info_t *tmp_dev;
sector_t block;
+ if (unlikely(bio_barrier(bio))) {
+ bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
if (bio_data_dir(bio)==WRITE) {
disk_stat_inc(mddev->gendisk, writes);
disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
diff ./drivers/md/multipath.c~current~ ./drivers/md/multipath.c
--- ./drivers/md/multipath.c~current~ 2005-08-02 15:23:02.000000000 +1000
+++ ./drivers/md/multipath.c 2005-08-02 15:23:02.000000000 +1000
@@ -169,6 +169,11 @@ static int multipath_make_request (reque
struct multipath_bh * mp_bh;
struct multipath_info *multipath;
+ if (unlikely(bio_barrier(bio))) {
+ bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
mp_bh->master_bio = bio;
diff ./drivers/md/raid0.c~current~ ./drivers/md/raid0.c
--- ./drivers/md/raid0.c~current~ 2005-08-02 15:23:02.000000000 +1000
+++ ./drivers/md/raid0.c 2005-08-02 15:23:02.000000000 +1000
@@ -404,6 +404,11 @@ static int raid0_make_request (request_q
unsigned long chunk;
sector_t block, rsect;
+ if (unlikely(bio_barrier(bio))) {
+ bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
if (bio_data_dir(bio)==WRITE) {
disk_stat_inc(mddev->gendisk, writes);
disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
diff ./drivers/md/raid1.c~current~ ./drivers/md/raid1.c
--- ./drivers/md/raid1.c~current~ 2005-08-02 15:23:02.000000000 +1000
+++ ./drivers/md/raid1.c 2005-08-02 15:23:02.000000000 +1000
@@ -555,6 +555,10 @@ static int make_request(request_queue_t
unsigned long flags;
struct bio_list bl;
+ if (unlikely(bio_barrier(bio))) {
+ bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
/*
* Register the new request and wait if the reconstruction
diff ./drivers/md/raid10.c~current~ ./drivers/md/raid10.c
--- ./drivers/md/raid10.c~current~ 2005-08-02 15:22:31.000000000 +1000
+++ ./drivers/md/raid10.c 2005-08-02 15:23:02.000000000 +1000
@@ -669,6 +669,11 @@ static int make_request(request_queue_t
int i;
int chunk_sects = conf->chunk_mask + 1;
+ if (unlikely(bio_barrier(bio))) {
+ bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
/* If this request crosses a chunk boundary, we need to
* split it. This will only happen for 1 PAGE (or less) requests.
*/
diff ./drivers/md/raid5.c~current~ ./drivers/md/raid5.c
--- ./drivers/md/raid5.c~current~ 2005-08-02 15:22:06.000000000 +1000
+++ ./drivers/md/raid5.c 2005-08-02 15:23:02.000000000 +1000
@@ -1411,6 +1411,11 @@ static int make_request (request_queue_t
sector_t logical_sector, last_sector;
struct stripe_head *sh;
+ if (unlikely(bio_barrier(bi))) {
+ bio_endio(bi, bi->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
md_write_start(mddev, bi);
if (bio_data_dir(bi)==WRITE) {
diff ./drivers/md/raid6main.c~current~ ./drivers/md/raid6main.c
--- ./drivers/md/raid6main.c~current~ 2005-08-02 15:22:06.000000000 +1000
+++ ./drivers/md/raid6main.c 2005-08-02 15:23:02.000000000 +1000
@@ -1570,6 +1570,11 @@ static int make_request (request_queue_t
sector_t logical_sector, last_sector;
struct stripe_head *sh;
+ if (unlikely(bio_barrier(bi))) {
+ bio_endio(bi, bi->bi_size, -EOPNOTSUPP);
+ return 0;
+ }
+
md_write_start(mddev, bi);
if (bio_data_dir(bi)==WRITE) {
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 002 of 7] Make 'md' and alias for 'md-mod'
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
2005-08-02 9:53 ` [PATCH md 004 of 7] Fail IO request to md that require a barrier NeilBrown
2005-08-02 9:53 ` [PATCH md 005 of 7] Always honour md bitmap being read from disk NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-02 9:53 ` [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases NeilBrown
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
Until the bitmap code was added,
modprobe md
would load the md module. But now the md module is called 'md-mod',
so we really need an alias for backwards comparability.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/md.c | 1 +
1 files changed, 1 insertion(+)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2005-08-02 15:22:11.000000000 +1000
+++ ./drivers/md/md.c 2005-08-02 15:22:22.000000000 +1000
@@ -4006,3 +4006,4 @@ EXPORT_SYMBOL(md_wakeup_thread);
EXPORT_SYMBOL(md_print_devices);
EXPORT_SYMBOL(md_check_recovery);
MODULE_LICENSE("GPL");
+MODULE_ALIAS("md");
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped.
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
` (5 preceding siblings ...)
2005-08-02 9:53 ` [PATCH md 001 of 7] Remove a stray debugging printk NeilBrown
@ 2005-08-02 9:53 ` NeilBrown
2005-08-04 5:10 ` [PATCH md 000 of 7] Introduction Andrew Morton
7 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-02 9:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
The recent change to never ignore the bitmap, revealed that the bitmap
isn't begin flushed properly when an array is stopped.
We call bitmap_daemon_work three times as there is a three-stage pipeline
for flushing updates to the bitmap file.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
### Diffstat output
./drivers/md/bitmap.c | 23 +++++++++++++++++++++++
./drivers/md/md.c | 2 ++
./include/linux/raid/bitmap.h | 1 +
3 files changed, 26 insertions(+)
diff ./drivers/md/bitmap.c~current~ ./drivers/md/bitmap.c
--- ./drivers/md/bitmap.c~current~ 2005-08-02 19:34:08.000000000 +1000
+++ ./drivers/md/bitmap.c 2005-08-02 19:34:58.000000000 +1000
@@ -1450,6 +1450,29 @@ static void bitmap_set_memory_bits(struc
}
/*
+ * flush out any pending updates
+ */
+void bitmap_flush(mddev_t *mddev)
+{
+ struct bitmap *bitmap = mddev->bitmap;
+ int sleep;
+
+ if (!bitmap) /* there was no bitmap */
+ return;
+
+ /* run the daemon_work three time to ensure everything is flushed
+ * that can be
+ */
+ sleep = bitmap->daemon_sleep;
+ bitmap->daemon_sleep = 0;
+ bitmap_daemon_work(bitmap);
+ bitmap_daemon_work(bitmap);
+ bitmap_daemon_work(bitmap);
+ bitmap->daemon_sleep = sleep;
+ bitmap_update_sb(bitmap);
+}
+
+/*
* free memory that was allocated
*/
void bitmap_destroy(mddev_t *mddev)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2005-08-02 15:22:22.000000000 +1000
+++ ./drivers/md/md.c 2005-08-02 19:34:28.000000000 +1000
@@ -1798,6 +1798,8 @@ static int do_md_stop(mddev_t * mddev, i
goto out;
mddev->ro = 1;
} else {
+ bitmap_flush(mddev);
+ wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
if (mddev->ro)
set_disk_ro(disk, 0);
blk_queue_make_request(mddev->queue, md_fail_request);
diff ./include/linux/raid/bitmap.h~current~ ./include/linux/raid/bitmap.h
--- ./include/linux/raid/bitmap.h~current~ 2005-08-02 19:34:28.000000000 +1000
+++ ./include/linux/raid/bitmap.h 2005-08-02 19:34:28.000000000 +1000
@@ -248,6 +248,7 @@ struct bitmap {
/* these are used only by md/bitmap */
int bitmap_create(mddev_t *mddev);
+void bitmap_flush(mddev_t *mddev);
void bitmap_destroy(mddev_t *mddev);
int bitmap_active(struct bitmap *bitmap);
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH md 000 of 7] Introduction
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
` (6 preceding siblings ...)
2005-08-02 9:53 ` [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped NeilBrown
@ 2005-08-04 5:10 ` Andrew Morton
2005-08-04 5:36 ` Neil Brown
7 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2005-08-04 5:10 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid
NeilBrown <neilb@cse.unsw.edu.au> wrote:
>
>
> Following are 7 patches for md in 2.6.13-rc4
> They are all fairly well tested, with the possible exception of '4' -
> I haven't actually tried throwing BIO_RW_BARRIER requests are any md
> devices. However the code is very straight forward.
>
> I'm happy (even keen) for these to go into 2.6.13.
> If it's getting a bit late, then 2 is probably the most important.
> The others we can probably live without.
>
hm, OK. Merging 1) and 2) seems sane. I must say that I worry about 4)
and would prefer to defer things if poss.
If there are others there which you really would prefer to see in 2.6.13
then please let me know.
>
>
> [PATCH md 001 of 7] Remove a stray debugging printk.
> [PATCH md 002 of 7] Make 'md' and alias for 'md-mod'
> [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation.
> [PATCH md 004 of 7] Fail IO requests to md that require a barrier.
> [PATCH md 005 of 7] Always honour md bitmap being read from disk
> [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases...
> [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH md 000 of 7] Introduction
2005-08-04 5:10 ` [PATCH md 000 of 7] Introduction Andrew Morton
@ 2005-08-04 5:36 ` Neil Brown
2005-08-04 5:45 ` Andrew Morton
0 siblings, 1 reply; 12+ messages in thread
From: Neil Brown @ 2005-08-04 5:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
On Wednesday August 3, akpm@osdl.org wrote:
> NeilBrown <neilb@cse.unsw.edu.au> wrote:
> >
> >
> > Following are 7 patches for md in 2.6.13-rc4
> > They are all fairly well tested, with the possible exception of '4' -
> > I haven't actually tried throwing BIO_RW_BARRIER requests are any md
> > devices. However the code is very straight forward.
> >
> > I'm happy (even keen) for these to go into 2.6.13.
> > If it's getting a bit late, then 2 is probably the most important.
> > The others we can probably live without.
> >
>
> hm, OK. Merging 1) and 2) seems sane. I must say that I worry about 4)
> and would prefer to defer things if poss.
Fair enough. 4 can wait until 2.6.14 (only a couple of months away,
right :-)
>
> If there are others there which you really would prefer to see in 2.6.13
> then please let me know.
>
5, 6, and 7 I would really prefer to be in 2.6.13.
The intent-bitmap stuff is broken (in small but potentially
significant ways) without them, and they are complete no-ops if
bitmaps aren't enabled:
5 only touches bitmap.c
6 removes the setting for R1BIO_Degraded which is not used and
slightly re-arranges an 'if' statement. All other changes are
complete no-ops if bitmaps aren't enabled.
7: if bitmaps aren't enabled, all this does is call "wait_event"
exactly the same way as will very possibly be called a few lines
later when md_update_sb is called.
So I'm convinced (and hopefully convincing) that they don't have any
significant effect if bitmaps aren't enabled, and fix genuine problems
with bitmaps, and so are appropriate for 2.6.13...
Thanks,
NeilBrown
>
> >
> >
> > [PATCH md 001 of 7] Remove a stray debugging printk.
> > [PATCH md 002 of 7] Make 'md' and alias for 'md-mod'
> > [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation.
> > [PATCH md 004 of 7] Fail IO requests to md that require a barrier.
> > [PATCH md 005 of 7] Always honour md bitmap being read from disk
> > [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases...
> > [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH md 000 of 7] Introduction
2005-08-04 5:36 ` Neil Brown
@ 2005-08-04 5:45 ` Andrew Morton
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2005-08-04 5:45 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
Neil Brown <neilb@cse.unsw.edu.au> wrote:
>
> On Wednesday August 3, akpm@osdl.org wrote:
> > NeilBrown <neilb@cse.unsw.edu.au> wrote:
> > >
> > >
> > > Following are 7 patches for md in 2.6.13-rc4
> > > They are all fairly well tested, with the possible exception of '4' -
> > > I haven't actually tried throwing BIO_RW_BARRIER requests are any md
> > > devices. However the code is very straight forward.
> > >
> > > I'm happy (even keen) for these to go into 2.6.13.
> > > If it's getting a bit late, then 2 is probably the most important.
> > > The others we can probably live without.
> > >
> >
> > hm, OK. Merging 1) and 2) seems sane. I must say that I worry about 4)
> > and would prefer to defer things if poss.
>
> Fair enough. 4 can wait until 2.6.14 (only a couple of months away,
> right :-)
Thereabouts..
> >
> > If there are others there which you really would prefer to see in 2.6.13
> > then please let me know.
> >
>
> 5, 6, and 7 I would really prefer to be in 2.6.13.
OK.
> The intent-bitmap stuff is broken (in small but potentially
> significant ways) without them, and they are complete no-ops if
> bitmaps aren't enabled:
> 5 only touches bitmap.c
> 6 removes the setting for R1BIO_Degraded which is not used and
> slightly re-arranges an 'if' statement. All other changes are
> complete no-ops if bitmaps aren't enabled.
> 7: if bitmaps aren't enabled, all this does is call "wait_event"
> exactly the same way as will very possibly be called a few lines
> later when md_update_sb is called.
>
> So I'm convinced (and hopefully convincing) that they don't have any
> significant effect if bitmaps aren't enabled, and fix genuine problems
> with bitmaps, and so are appropriate for 2.6.13...
We'll see ;)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH md 000 of 7] Introduction
@ 2005-08-29 7:33 NeilBrown
0 siblings, 0 replies; 12+ messages in thread
From: NeilBrown @ 2005-08-29 7:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-raid
Herewith, a group of patches for md/raid in 2.6.13-mm.
They (together with the md patches already in -mm) are all appropriate
for the flood which will be pouring in to Linus now that 2.6.13 is
out.
There are a few bug fixes (it's SO good having a test suite to help find these),
a couple of code cleanups, and the write-intent-logging stuff is now supported
on raid4/5/6 as well as raid1.
Thanks,
NeilBrown
[PATCH md 001 of 7] Remove old cruft from md_k.h header file.
[PATCH md 002 of 7] Limit size of sb read/written to appropriate amount.
[PATCH md 003 of 7] Add write-intent-bitmap support to raid5
[PATCH md 004 of 7] write-intent bitmap support for raid6
[PATCH md 005 of 7] Use kthread infrastructure in md
[PATCH md 006 of 7] Ensure bitmap_writeback_daemon handles shutdown properly.
[PATCH md 007 of 7] Tidy up daemon stop/start code in md/bitmap.c
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-08-29 7:33 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 9:53 [PATCH md 000 of 7] Introduction NeilBrown
2005-08-02 9:53 ` [PATCH md 004 of 7] Fail IO request to md that require a barrier NeilBrown
2005-08-02 9:53 ` [PATCH md 005 of 7] Always honour md bitmap being read from disk NeilBrown
2005-08-02 9:53 ` [PATCH md 002 of 7] Make 'md' and alias for 'md-mod' NeilBrown
2005-08-02 9:53 ` [PATCH md 006 of 7] Yet another attempt to get bitmap-based resync to do the right thing in all cases NeilBrown
2005-08-02 9:53 ` [PATCH md 003 of 7] Fix minor error in raid10 read-balancing calculation NeilBrown
2005-08-02 9:53 ` [PATCH md 001 of 7] Remove a stray debugging printk NeilBrown
2005-08-02 9:53 ` [PATCH md 007 of 7] Make sure md bitmap updates are flushed when array is stopped NeilBrown
2005-08-04 5:10 ` [PATCH md 000 of 7] Introduction Andrew Morton
2005-08-04 5:36 ` Neil Brown
2005-08-04 5:45 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2005-08-29 7:33 NeilBrown
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).