diff options
author | NeilBrown <neilb@suse.de> | 2010-06-23 23:31:03 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-06-23 23:31:03 -0400 |
commit | f3b99be19ded511a1bf05a148276239d9f13eefa (patch) | |
tree | c9e59617e67e7a43e38b5c41f3307d54f4279c13 /drivers | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Restore partition detection of newly created md arrays.
Commit b821eaa572fd737faaf6928ba046e571526c36c6 broke partition
detection for md arrays.
The logic was almost right. However if revalidate_disk is called
when the device is not yet open, bdev->bd_disk won't be set, so the
flush_disk() Call will not set bd_invalidated.
So when md_open is called we still need to ensure that
->bd_invalidated gets set. This is easily done with a call to
check_disk_size_change in the place where the offending commit removed
check_disk_change. At the important times, the size will have changed
from 0 to non-zero, so check_disk_size_change will set bd_invalidated.
Tested-by: Duncan <1i5t5.duncan@cox.net>
Reported-by: Duncan <1i5t5.duncan@cox.net>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 46b3a044eadf..4edcda8f4869 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5895,6 +5895,7 @@ static int md_open(struct block_device *bdev, fmode_t mode) | |||
5895 | atomic_inc(&mddev->openers); | 5895 | atomic_inc(&mddev->openers); |
5896 | mutex_unlock(&mddev->open_mutex); | 5896 | mutex_unlock(&mddev->open_mutex); |
5897 | 5897 | ||
5898 | check_disk_size_change(mddev->gendisk, bdev); | ||
5898 | out: | 5899 | out: |
5899 | return err; | 5900 | return err; |
5900 | } | 5901 | } |