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

Andreas Dilger (adilger@turbolabs.com)
Thu, 27 Dec 2001 10:18:46 -0700


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
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/