Re: [lvm-devel] Re: lvm in 2.5.1

Andreas Dilger
2001-12-27T17:20:46Z

On Dec 27, 2001 17:02 +0100, andersg@0x63.nu wrote:
> you mean like this?
>
> --
>
> //anders/g
>
> diff -ru linux-2.5.2-pre2/drivers/md/lvm.c linux-2.5.2-pre2-lvmfix/drivers/md/lvm.c
> --- linux-2.5.2-pre2/drivers/md/lvm.c Thu Dec 27 08:28:39 2001
> +++ linux-2.5.2-pre2-lvmfix/drivers/md/lvm.c Thu Dec 27 16:43:52 2001
> @@ -1533,8 +1549,10 @@
> }
> vg_ptr->lv[l] = NULL;
> /* only create original logical volumes for now */
> - if (lvm_do_lv_create(minor, lv.lv_name, &lv) != 0) {
> + if (lvm_do_lv_create(minor, tmplv->lv_name, tmplv) != 0) {
> lvm_do_vg_remove(minor);
> + vfree(snap_lv_ptr);
> + kfree(tmplv);
> return -EFAULT;
> }
> }

How about re-doing this to look more like:

lvm_do_vg_remove(minor);
ret = -EFAULT;
goto exit_lv;
}
}
.
.
.
vg_count++;

MOD_INC_USE_COUNT;

/* let's go active */
vg_ptr->vg_status |= VG_ACTIVE;

exit_lv:
kfree(tmplv);
exit_snap:
vfree(snap_lv_ptr);

return ret;
}

Cheers, Andreas
--
Andreas Dilger