Bug 1084944
| Summary: | Events based on WATCH udev rule cause the udev db to be out of sync with real state if inotify events are coalesced | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Marius Vollmer <mvollmer> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 20 | CC: | agk, bmarzins, bmr, dwysocha, heinzm, johannbg, jonathan, lnykryn, lvm-team, msekleta, msnitzer, mvollmer, ohadlevy, plautrba, prajnoha, prockai, systemd-maint, vpavlin, zbyszek, zkabelac |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-06-23 08:54:42 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Marius Vollmer
2014-04-07 11:04:32 UTC
When running the vgcreate step-by-step in debugger, there are actually 4 events generated. When running it on cmd line as usual, there's only 1 event seen which is the result of udev coalescing these events if they happen too close each other in time. Unfortunately, the state in udev db does not reflect the final state. So this is actually a dup of bug #1066525 (rawhide). I'll keep this one open for F20. Changing to systemd/udev component. (In reply to Peter Rajnoha from comment #1) > When running the vgcreate step-by-step in debugger, there are actually 4 > events generated. When running it on cmd line as usual, there's only 1 event > seen which is the result of udev coalescing these events if they happen too > close each other in time. Unfortunately, the state in udev db does not > reflect the final state. *groan* So udev ignores some events that happen shortly after another event? That would mean that the obvious workaround of artificially triggering an event after vgcreate doesn't work. (In reply to Marius Vollmer from comment #2) > (In reply to Peter Rajnoha from comment #1) > > When running the vgcreate step-by-step in debugger, there are actually 4 > > events generated. When running it on cmd line as usual, there's only 1 event > > seen which is the result of udev coalescing these events if they happen too > > close each other in time. Unfortunately, the state in udev db does not > > reflect the final state. > > *groan* > > So udev ignores some events that happen shortly after another event? That > would mean that the obvious workaround of artificially triggering an event > after vgcreate doesn't work. This might be only related to the way how inotify events (the "WATCH" rule) are processedd so probably the trigger is not affected here. There's a note in "man 7 inotify": "If successive output inotify events produced on the inotify file descriptor are identical (same wd, mask, cookie, and name) then they are coalesced into a single event if the older event has not yet been read (but see BUGS). BUGS In kernels before 2.6.16, the IN_ONESHOT mask flag does not work. Before kernel 2.6.25, the kernel code that was intended to coalesce successive identical events (i.e., the two most recent events could potentially be coalesced if the older had not yet been read) instead checked if the most recent event could be coalesced with the oldest unread event." So someone from udev team should check this and then probably redirect it to kernel if it appears to be a kernel bug. I can't evaluate this properly since I don't see into udev code much... *** Bug 1066525 has been marked as a duplicate of this bug. *** I cannot reproduce this, it works just fine on a real disk. I have no idea about the virtio stuff. Please try if this also fails for you with other devices than virtio. $ udevadm monitor -u & $ vgcreate demo /dev/sdd UDEV [2371.079259] change [...]/block/sdd (block) Physical volume "/dev/sdd" successfully created Volume group "demo" successfully created $ udevadm info /dev/sdd [...] E: ID_FS_USAGE=raid E: ID_FS_UUID=9QRiym-RB2e-RNDt-9qUc-9cGP-fqOH-kkWb5O E: ID_FS_UUID_ENC=9QRiym-RB2e-RNDt-9qUc-9cGP-fqOH-kkWb5O E: ID_FS_VERSION=LVM2 001 [...] (In reply to Kay Sievers from comment #5) > I cannot reproduce this, it works just fine on a real disk. I can't reproduce it anymore either. Time heals all wounds. :-) Thanks for checking! |