svn commit: r219645 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Mon Mar 14 19:31:43 UTC 2011
Author: mav
Date: Mon Mar 14 19:31:43 2011
New Revision: 219645
URL: http://svn.freebsd.org/changeset/base/219645
Log:
Don't forget to read subdisks position/sizes from metadata.
Modified:
projects/graid/head/sys/geom/raid/md_promise.c
Modified: projects/graid/head/sys/geom/raid/md_promise.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_promise.c Mon Mar 14 19:04:44 2011 (r219644)
+++ projects/graid/head/sys/geom/raid/md_promise.c Mon Mar 14 19:31:43 2011 (r219645)
@@ -590,6 +590,10 @@ nofit:
g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE);
*/ else
g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE);
+
+ sd->sd_offset = pd->pd_meta[sdn]->disk_offset * 512;
+ sd->sd_size = pd->pd_meta[sdn]->disk_sectors * 512;
+
/* Up to date disk. */
g_raid_change_subdisk_state(sd,
G_RAID_SUBDISK_S_ACTIVE);
@@ -782,6 +786,7 @@ static void
g_raid_md_promise_start(struct g_raid_volume *vol)
{
struct g_raid_softc *sc;
+ struct g_raid_subdisk *sd;
struct g_raid_disk *disk;
struct g_raid_md_object *md;
struct g_raid_md_promise_object *mdi;
@@ -818,6 +823,11 @@ g_raid_md_promise_start(struct g_raid_vo
vol->v_disks_count = meta->total_disks;
vol->v_mediasize = (off_t)meta->total_sectors * 512; //ZZZ
vol->v_sectorsize = 512; //ZZZ
+ for (i = 0; i < vol->v_disks_count; i++) {
+ sd = &vol->v_subdisks[i];
+ sd->sd_offset = (off_t)meta->disk_offset * 512; //ZZZ
+ sd->sd_size = (off_t)meta->disk_sectors * 512; //ZZZ
+ }
g_raid_start_volume(vol);
/* Make all disks found till the moment take their places. */
More information about the svn-src-projects
mailing list