Bug 183670 - lvcreate - race condition creating snapshots
Summary: lvcreate - race condition creating snapshots
Status: RESOLVED DUPLICATE of bug 178321
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 SuSE Linux 10.1
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Thomas Fehr
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-10 17:55 UTC by Robert Valentan
Modified: 2006-06-12 11:55 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Valentan 2006-06-10 17:55:05 UTC
---- copy of email to linux-lvm@redhat.com --------
I think, there is a race condition in lvcreate while
makeing a new snapshot.

System: Tyan with 2 Opteron 246
        xen 3.0.2-3
        linux 2.6.16.13
        lvm 2.02.07
        3ware-Raid 9550 Raid5

Under xen i was unable to create a snapshot, I got
always "LV system/snap in use: not deactivating".
Without xen, i got occasionally a snapshot.


After i make a "dirty hack"..
------ begin ----------
*** old/lvcreate.c      2006-06-10 19:22:37.000000000 +0200
--- lvcreate.c  2006-06-10 19:23:04.000000000 +0200
***************
*** 776,781 ****
--- 776,787 ----
                /* Reset permission after zeroing */
                if (!(lp->permission & LVM_WRITE))
                        lv->status &= ~LVM_WRITE;
+
+                 { struct timeval tv ;
+                   tv.tv_sec=10;
+                   tv.tv_usec=0;
+                   select(2, 0, 0, 0, &tv);
+                 }
                if (!deactivate_lv(cmd, lv)) {
                        log_err("Couldn't deactivate new snapshot.");
                        return 0;
------ end ---------
.. i got always a snapshot (on all 3 systems!). I think, there is an
other thread which is creating the new lv, and it will take longer as
the lvcreate will "think". I have to less knowledge to make a patch,
which is waiting for the correct event (creating lv complete).
Comment 1 Thomas Fehr 2006-06-12 11:55:36 UTC
This problem is caused by udev.
Currently it is not possible in SL 10.1 to reliably create snapshot while udevd 
is running. 
I would suggest to temporarily deactivate udevd while creating snapshots.

*** This bug has been marked as a duplicate of 178321 ***