* [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create()
@ 2006-09-25 10:12 more.zeng
0 siblings, 0 replies; 3+ messages in thread
From: more.zeng @ 2006-09-25 10:12 UTC (permalink / raw)
To: lvm-cvs; +Cc: linux-lvm
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create()
@ 2006-09-25 10:23 more.zeng
2006-09-27 3:33 ` more.zeng
0 siblings, 1 reply; 3+ messages in thread
From: more.zeng @ 2006-09-25 10:23 UTC (permalink / raw)
To: linux-lvm
[-- 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: 10441 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create()
2006-09-25 10:23 more.zeng
@ 2006-09-27 3:33 ` more.zeng
0 siblings, 0 replies; 3+ messages in thread
From: more.zeng @ 2006-09-27 3:33 UTC (permalink / raw)
To: 'LVM general discussion and development'
[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]
Can anyone have a view of the following issue in the LVM1 kernel code? Very thanks for any comment.
Best regards,
More
_____
From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com] On Behalf Of more.zeng
Sent: 2006年9月25日 18:24
To: linux-lvm@redhat.com
Subject: [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create()
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: 13604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-27 3:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-25 10:12 [linux-lvm] A problem in LVM1 kernel code lvm.c::lvm_do_vg_create() more.zeng
-- strict thread matches above, loose matches on Subject: below --
2006-09-25 10:23 more.zeng
2006-09-27 3:33 ` more.zeng
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).