Skip to content

Commit

Permalink
Merge tag 'md/3.16-fixes' of git://neil.brown.name/md
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Jul 4, 2014
2 parents 88b5a85 + 133d452 commit 77c4cf1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -5599,7 +5599,7 @@ static int get_array_info(struct mddev * mddev, void __user * arg)
if (mddev->in_sync)
info.state = (1<<MD_SB_CLEAN);
if (mddev->bitmap && mddev->bitmap_info.offset)
info.state = (1<<MD_SB_BITMAP_PRESENT);
info.state |= (1<<MD_SB_BITMAP_PRESENT);
info.active_disks = insync;
info.working_disks = working;
info.failed_disks = failed;
Expand Down Expand Up @@ -7501,6 +7501,19 @@ void md_do_sync(struct md_thread *thread)
rdev->recovery_offset < j)
j = rdev->recovery_offset;
rcu_read_unlock();

/* If there is a bitmap, we need to make sure all
* writes that started before we added a spare
* complete before we start doing a recovery.
* Otherwise the write might complete and (via
* bitmap_endwrite) set a bit in the bitmap after the
* recovery has checked that bit and skipped that
* region.
*/
if (mddev->bitmap) {
mddev->pers->quiesce(mddev, 1);
mddev->pers->quiesce(mddev, 0);
}
}

printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev));
Expand Down

0 comments on commit 77c4cf1

Please sign in to comment.