Read/write GMIRROR metadata
aelvira35 at hotmail.com
Fri Apr 9 19:03:33 UTC 2010
i´m developing a patch for geom mirror module to acelerate synchronizing
between providers, using bitmaps to write in the provider only modified
data since the last rebuilding.
I have a trouble in the first access to the new provider attached,
before mirror creation, when i execute gmirror label ....
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´t
understand "who" and "when" have been written these metadata, because in
debugging mode, i´ve set breakpoints in functions that write data in
provider (g_mirror_write_metadata and g_write_data) and "aparently"
these are not called.
If i add new fields to metadata (e.g., the number of bitmaps stored in
disk), the hash obtained in second read (latest 16 bytes of last sector)
no matches with hash coded (which includes all metadata fields) in
mirror_metadata_decode_v3v4 function, and that function returns error
again. Also i have checked the modifications made in
mirror_metadata_decode_v3_v4 to support this new field, and i don´t find
In summary, i would like to modify the metadata structure, but if i do
that, there are conflicts with hashes. It seems like metadata were
written with stole information before read it, and i cannot find this step.
Could anyone give me any feedback about it?
More information about the freebsd-geom