Date: Thu, 3 Feb 2011 18:47:13 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r218230 - projects/graid/head/sys/geom/raid Message-ID: <201102031847.p13IlDVC054756@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Feb 3 18:47:13 2011 New Revision: 218230 URL: http://svn.freebsd.org/changeset/base/218230 Log: Fix writing/dumping to non-OPTIMAL RAID1 volumes. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Thu Feb 3 18:25:55 2011 (r218229) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Thu Feb 3 18:47:13 2011 (r218230) @@ -481,6 +481,7 @@ g_raid_tr_iostart_raid1_write(struct g_r if (bp->bio_offset >= sd->sd_rebuild_pos) continue; break; + case G_RAID_SUBDISK_S_STALE: case G_RAID_SUBDISK_S_RESYNC: /* * Resyncing still writes on the theory that the @@ -488,6 +489,7 @@ g_raid_tr_iostart_raid1_write(struct g_r * keep it that way better if we keep up while * resyncing. */ + break; default: continue; } @@ -818,10 +820,23 @@ g_raid_tr_kerneldump_raid1(struct g_raid switch (sd->sd_state) { case G_RAID_SUBDISK_S_ACTIVE: break; -// case G_RAID_DISK_STATE_SYNCHRONIZING: -// if (bp->bio_offset >= sync->ds_offset) -// continue; -// break; + case G_RAID_SUBDISK_S_REBUILD: + /* + * When rebuilding, only part of this subdisk is + * writable, the rest will be written as part of the + * that process. + */ + if (offset >= sd->sd_rebuild_pos) + continue; + break; + case G_RAID_SUBDISK_S_STALE: + case G_RAID_SUBDISK_S_RESYNC: + /* + * Resyncing still writes on the theory that the + * resync'd disk is very close and writing it will + * keep it that way better if we keep up while + * resyncing. + */ default: continue; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031847.p13IlDVC054756>