[linux-lvm] A question about the metadata circular buffer

yuan yuan duanyuan0526 at 163.com
Fri Dec 12 12:35:46 UTC 2008


Hi guys

     I have been reading the source code of lvm2 recently and met a
question.

     In the file lib/format_text/format-text.c :

      static int _vg_write_raw(struct format_instance *fid, struct
volume_group *vg,
                         struct metadata_area *mda)
{
 .....
    if ((new_wrap && old_wrap) ||
            (rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset))
||
            (mdac->rlocn.size >= mdah->size)) {
                log_error("VG %s metadata too large for circular buffer",
                          vg->name);
                goto out;
        }
......
}

My question is , for a circular buffer, why should we check so many
conditions instead of just checking (mdac->rlocn.size >= mdah->size)?
forgive my poor english. 3ks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20081212/45105dc0/attachment.htm>


More information about the linux-lvm mailing list