Date: Sat, 10 Apr 2010 17:43:17 +0200 From: Ivan Voras <ivoras@freebsd.org> To: freebsd-geom@freebsd.org Subject: Re: Read/write GMIRROR metadata Message-ID: <hpq6am$ogf$1@dough.gmane.org> In-Reply-To: <BLU0-SMTP401B53789F38FEAF59BA60AD150@phx.gbl> References: <BLU0-SMTP401B53789F38FEAF59BA60AD150@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
Alfredo Elvira wrote: > Hello, >=20 > i=C2=B4m developing a patch for geom mirror module to acelerate synchro= nizing > between providers, using bitmaps to write in the provider only modified= > data since the last rebuilding. >=20 > I have a trouble in the first access to the new provider attached, > before mirror creation, when i execute gmirror label .... >=20 > When the first clean disk is attached, the system runs the > g_mirror_taste function for two times. The first one, there are not > valid metadata for mirror class and g_mirror_read_metadata function > returns error 22. But the second one, valid metadata are read. I don=C2= =B4t Usually, the first time your code gets to taste the device before it's=20 labeled, e.g. when it first appears in the system, etc. Then, when=20 something opens the device for writing and then closes is ("spoils it"), = all GEOM classes are given the opportunity to taste the device again to=20 see if they can use it. > understand "who" and "when" have been written these metadata, because i= n > debugging mode, i=C2=B4ve set breakpoints in functions that write data = in > provider (g_mirror_write_metadata and g_write_data) and "aparently" > these are not called. Metadata in the "label" step is done in userland, by the gmirror utility = (or more specifically, /lib/geom/geom_mirror.so). The usual situation is like this: you need to keep the userland and the=20 kernel code in sync, and this also goes for metadata structures. After=20 the userland does "label", it usually (except for "clean") does not=20 touch the metadata - from there on it's all kernel.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hpq6am$ogf$1>