diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 2 | ||||
-rw-r--r-- | drivers/md/raid1.c | 5 | ||||
-rw-r--r-- | drivers/md/raid5.c | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index cd12fca73b0d..8175a2a222da 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1729,7 +1729,7 @@ level_show(mddev_t *mddev, char *page) | |||
1729 | if (p == NULL && mddev->raid_disks == 0) | 1729 | if (p == NULL && mddev->raid_disks == 0) |
1730 | return 0; | 1730 | return 0; |
1731 | if (mddev->level >= 0) | 1731 | if (mddev->level >= 0) |
1732 | return sprintf(page, "RAID-%d\n", mddev->level); | 1732 | return sprintf(page, "raid%d\n", mddev->level); |
1733 | else | 1733 | else |
1734 | return sprintf(page, "%s\n", p->name); | 1734 | return sprintf(page, "%s\n", p->name); |
1735 | } | 1735 | } |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 3066c587b539..229d7b204297 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -320,7 +320,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
320 | * this branch is our 'one mirror IO has finished' event handler: | 320 | * this branch is our 'one mirror IO has finished' event handler: |
321 | */ | 321 | */ |
322 | r1_bio->bios[mirror] = NULL; | 322 | r1_bio->bios[mirror] = NULL; |
323 | bio_put(bio); | ||
324 | if (!uptodate) { | 323 | if (!uptodate) { |
325 | md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); | 324 | md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); |
326 | /* an I/O failed, we can't clear the bitmap */ | 325 | /* an I/O failed, we can't clear the bitmap */ |
@@ -377,7 +376,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
377 | } | 376 | } |
378 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { | 377 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { |
379 | /* free extra copy of the data pages */ | 378 | /* free extra copy of the data pages */ |
380 | /* FIXME bio has been freed!!! */ | ||
381 | int i = bio->bi_vcnt; | 379 | int i = bio->bi_vcnt; |
382 | while (i--) | 380 | while (i--) |
383 | __free_page(bio->bi_io_vec[i].bv_page); | 381 | __free_page(bio->bi_io_vec[i].bv_page); |
@@ -391,6 +389,9 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
391 | raid_end_bio_io(r1_bio); | 389 | raid_end_bio_io(r1_bio); |
392 | } | 390 | } |
393 | 391 | ||
392 | if (r1_bio->bios[mirror]==NULL) | ||
393 | bio_put(bio); | ||
394 | |||
394 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); | 395 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); |
395 | return 0; | 396 | return 0; |
396 | } | 397 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 36d5f8ac8265..fafc4bc045f7 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -98,7 +98,7 @@ static inline void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh) | |||
98 | list_add_tail(&sh->lru, &conf->inactive_list); | 98 | list_add_tail(&sh->lru, &conf->inactive_list); |
99 | atomic_dec(&conf->active_stripes); | 99 | atomic_dec(&conf->active_stripes); |
100 | if (!conf->inactive_blocked || | 100 | if (!conf->inactive_blocked || |
101 | atomic_read(&conf->active_stripes) < (NR_STRIPES*3/4)) | 101 | atomic_read(&conf->active_stripes) < (conf->max_nr_stripes*3/4)) |
102 | wake_up(&conf->wait_for_stripe); | 102 | wake_up(&conf->wait_for_stripe); |
103 | } | 103 | } |
104 | } | 104 | } |
@@ -264,7 +264,8 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector | |||
264 | conf->inactive_blocked = 1; | 264 | conf->inactive_blocked = 1; |
265 | wait_event_lock_irq(conf->wait_for_stripe, | 265 | wait_event_lock_irq(conf->wait_for_stripe, |
266 | !list_empty(&conf->inactive_list) && | 266 | !list_empty(&conf->inactive_list) && |
267 | (atomic_read(&conf->active_stripes) < (NR_STRIPES *3/4) | 267 | (atomic_read(&conf->active_stripes) |
268 | < (conf->max_nr_stripes *3/4) | ||
268 | || !conf->inactive_blocked), | 269 | || !conf->inactive_blocked), |
269 | conf->device_lock, | 270 | conf->device_lock, |
270 | unplug_slaves(conf->mddev); | 271 | unplug_slaves(conf->mddev); |
@@ -1917,7 +1918,7 @@ static int run(mddev_t *mddev) | |||
1917 | goto abort; | 1918 | goto abort; |
1918 | } | 1919 | } |
1919 | } | 1920 | } |
1920 | memory = conf->max_nr_stripes * (sizeof(struct stripe_head) + | 1921 | memory = conf->max_nr_stripes * (sizeof(struct stripe_head) + |
1921 | conf->raid_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024; | 1922 | conf->raid_disks * ((sizeof(struct bio) + PAGE_SIZE))) / 1024; |
1922 | if (grow_stripes(conf, conf->max_nr_stripes)) { | 1923 | if (grow_stripes(conf, conf->max_nr_stripes)) { |
1923 | printk(KERN_ERR | 1924 | printk(KERN_ERR |