[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]