Merge lp:~serge-hallyn/ubuntu/lucid/initramfs-tools/udevsettle into lp:ubuntu/lucid/initramfs-tools

Proposed by Serge Hallyn
Status: Needs review
Proposed branch: lp:~serge-hallyn/ubuntu/lucid/initramfs-tools/udevsettle
Merge into: lp:ubuntu/lucid/initramfs-tools
Diff against target: 46 lines (+24/-3)
2 files modified
debian/changelog (+12/-0)
scripts/local (+12/-3)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/lucid/initramfs-tools/udevsettle
Reviewer Review Type Date Requested Status
Evan Broder (community) Needs Information
Review via email: mp+43140@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Sorry - changelog snafu. This merge should be against Natty of course,
and SRU'd back to maverick, lucid, and karmic, at least.

195. By Serge Hallyn

fix target release in changelog

Revision history for this message
Evan Broder (broder) wrote :

How exactly does multipath interact with devices that have already been mounted?

If I manage to mount /dev/disk/by-uuid/whatever *before* the multipath udev rule triggers, does that mean that the non-coalesced device stays mounted, or can multipath magically swap the devices out?

If it's the former, then it seems like there's still a problem if mountroot() outright wins the race against the udev rule. It seems like the better solution would be to add a local-premount script to multipath-tools-boot that does a udevadm settle, although it's worth noting that that will potentially impact boot time.

If it's the latter, then I'm not sure I understand the point of the multipath-tools-boot package.

review: Needs Information
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

That sounds like a good alternative, though if the race
you're worried about is real (I'm not certain if anything
prevents it, though I"ve never seen it) then I don't think
it would prevent it by itself.

I like the alternative for keeping the multipath fixes
closer to multipath itself. Thanks for the suggestion.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Evan:

I don't want to 'delete' this proposal because that will
delete the comments. But there is no 'withdraw' option.
Could you hit 'reject' to close this please?

(I have the proposed alternate patch to multipath-tools,
and am proposing it to debian for starters)

thanks,
-serge

Unmerged revisions

195. By Serge Hallyn

fix target release in changelog

194. By Serge Hallyn

Clean up changelog for merge, and add a new non-private bug
that this closes.

193. By Serge Hallyn

version bump for maverick ppa.

192. By Serge Hallyn

bump ubuntu version

191. By Serge Hallyn

oops, it's udevadm settle, not udevsettle

190. By Serge Hallyn

fix version number

189. By Serge Hallyn

When using multipath, it is possible that mountroot() will race
with udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from
/dev/sd?? to /dev/mapper/something. After multipath has grabbed
the /dev/sd?? and until udev completes the rename, mounting
/dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY. In that
case, call 'udevsettle' to wait until udev has finished all its
related actions.

(I wonder whether we should only do udevsettle if we got
-EBUSY, and fail as usual otherwise)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-04-26 15:17:47 +0000
3+++ debian/changelog 2010-12-08 21:47:46 +0000
4@@ -1,3 +1,15 @@
5+initramfs-tools (0.92bubuntu79) natty; urgency=low
6+
7+ * When using multipath, it is possible that mountroot() will race
8+ with udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from
9+ /dev/sd?? to /dev/mapper/something. After multipath has grabbed
10+ the /dev/sd?? and until udev completes the rename, mounting
11+ /dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY. In that
12+ case, call 'udevsettle' to wait until udev has finished all its
13+ related actions. (Closes LP: #686832)
14+
15+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Fri, 19 Nov 2010 12:19:43 -0600
16+
17 initramfs-tools (0.92bubuntu78) lucid; urgency=low
18
19 * hooks/compcache: Escape $-expansions inside <<EOF (thanks, Eugene San;
20
21=== modified file 'scripts/local'
22--- scripts/local 2009-12-21 23:06:53 +0000
23+++ scripts/local 2010-12-08 21:47:46 +0000
24@@ -69,10 +69,19 @@
25 # FIXME This has no error checking
26 [ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
27
28- # FIXME This has no error checking
29 # Mount root
30- mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
31- mountroot_status="$?"
32+ tries=0
33+ ret=1
34+ while [ $tries -lt 2 -a $ret -ne 0 ]; do
35+ mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
36+ ret=$?
37+ if [ $ret -ne 0 ]; then
38+ echo "failed attempt $tries to mount $ROOT as root"
39+ udevadm settle
40+ tries=$((tries+1))
41+ fi
42+ done
43+ mountroot_status=$ret
44 if [ "$LOOP" ]; then
45 if [ "$mountroot_status" != 0 ]; then
46 if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then

Subscribers

People subscribed via source and target branches