From: "more.zeng" <mzeng@plasmon.cn>
To: lvm-cvs@sources.redhat.com
Cc: linux-lvm@redhat.com
Subject: [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create()
Date: Mon, 25 Sep 2006 18:12:12 +0800 [thread overview]
Message-ID: <200609251110.k8PBAINQ017628@mx3.redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]
Dear LVM guys,
I find an issue in the LVM1 kernel code for function lvm.c::lvm_do_vg_create():
In the original code, the vg_count will be increased only when this function is executed successfully. But I think the vg_count should be increased after the variable vg[VG_CHR(minor)] is updated. Given the reason that after the variable vg[VG_CHR(minor)] is updated, for any failure case, lvm_do_vg_create() will always call lvm_do_vg_remove() that will decrease the vg_count. So the vg_count should be increased first before any call for lvm_do_vg_remove().
This issue did exist for our product for our LV sometimes will fail to start (corrupt snapshot). Please give me the confirmation that the above is really an issue and the following diff can resolve this issue (from the latest LVM1 CVS code), thanks.
Best regards,
More
Index: lvm.c
===================================================================
RCS file: /cvs/lvm/LVM/kernel/lvm.c,v
retrieving revision 1.81
diff -c -r1.81 lvm.c
*** lvm.c 5 Mar 2003 11:37:16 -0000 1.81
--- lvm.c 25 Sep 2006 09:57:26 -0000
***************
*** 1802,1807 ****
--- 1802,1809 ----
vg[VG_CHR(minor)] = vg_ptr;
+ vg_count++;
+
/* get the physical volume structures */
vg_ptr->pv_act = vg_ptr->pv_cur = 0;
for (p = 0; p < vg_ptr->pv_max; p++) {
***************
*** 1870,1877 ****
vfree(snap_lv_ptr);
- vg_count++;
-
MOD_INC_USE_COUNT;
--- 1872,1877 ----
[-- Attachment #2: Type: text/html, Size: 8859 bytes --]
next reply other threads:[~2006-09-25 11:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 10:12 more.zeng [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-09-25 10:23 [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create() more.zeng
2006-09-27 3:33 ` more.zeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200609251110.k8PBAINQ017628@mx3.redhat.com \
--to=mzeng@plasmon.cn \
--cc=linux-lvm@redhat.com \
--cc=lvm-cvs@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).