diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-04 12:37:43 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-04 12:37:43 -0400 |
| commit | 77c4cf17ae867ba93233b3832bda3de7adaae326 (patch) | |
| tree | 3483cfb14a484cb7ecfe7846fc074360cfd73e5e | |
| parent | 88b5a850c88a3fd0e9d050d35962259e029e43f4 (diff) | |
| parent | 133d4527eab8d199a62eee6bd433f0776842df2e (diff) | |
Merge tag 'md/3.16-fixes' of git://neil.brown.name/md
Pull md bugfixes from Neil Brown:
"Two minor bugfixes for md in 3.16"
* tag 'md/3.16-fixes' of git://neil.brown.name/md:
md: flush writes before starting a recovery.
md: make sure GET_ARRAY_INFO ioctl reports correct "clean" status
| -rw-r--r-- | drivers/md/md.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 34846856dbc6..32fc19c540d4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -5599,7 +5599,7 @@ static int get_array_info(struct mddev * mddev, void __user * arg) | |||
| 5599 | if (mddev->in_sync) | 5599 | if (mddev->in_sync) |
| 5600 | info.state = (1<<MD_SB_CLEAN); | 5600 | info.state = (1<<MD_SB_CLEAN); |
| 5601 | if (mddev->bitmap && mddev->bitmap_info.offset) | 5601 | if (mddev->bitmap && mddev->bitmap_info.offset) |
| 5602 | info.state = (1<<MD_SB_BITMAP_PRESENT); | 5602 | info.state |= (1<<MD_SB_BITMAP_PRESENT); |
| 5603 | info.active_disks = insync; | 5603 | info.active_disks = insync; |
| 5604 | info.working_disks = working; | 5604 | info.working_disks = working; |
| 5605 | info.failed_disks = failed; | 5605 | info.failed_disks = failed; |
| @@ -7501,6 +7501,19 @@ void md_do_sync(struct md_thread *thread) | |||
| 7501 | rdev->recovery_offset < j) | 7501 | rdev->recovery_offset < j) |
| 7502 | j = rdev->recovery_offset; | 7502 | j = rdev->recovery_offset; |
| 7503 | rcu_read_unlock(); | 7503 | rcu_read_unlock(); |
| 7504 | |||
| 7505 | /* If there is a bitmap, we need to make sure all | ||
| 7506 | * writes that started before we added a spare | ||
| 7507 | * complete before we start doing a recovery. | ||
| 7508 | * Otherwise the write might complete and (via | ||
| 7509 | * bitmap_endwrite) set a bit in the bitmap after the | ||
| 7510 | * recovery has checked that bit and skipped that | ||
| 7511 | * region. | ||
| 7512 | */ | ||
| 7513 | if (mddev->bitmap) { | ||
| 7514 | mddev->pers->quiesce(mddev, 1); | ||
| 7515 | mddev->pers->quiesce(mddev, 0); | ||
| 7516 | } | ||
| 7504 | } | 7517 | } |
| 7505 | 7518 | ||
| 7506 | printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev)); | 7519 | printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev)); |
