Merge lp:~serge-hallyn/ubuntu/natty/initramfs-tools/retrymount into lp:ubuntu/natty/initramfs-tools

Proposed by Serge Hallyn
Status: Needs review
Proposed branch: lp:~serge-hallyn/ubuntu/natty/initramfs-tools/retrymount
Merge into: lp:ubuntu/natty/initramfs-tools
Diff against target: 45 lines (+23/-3)
2 files modified
debian/changelog (+11/-0)
scripts/local (+12/-3)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/natty/initramfs-tools/retrymount
Reviewer Review Type Date Requested Status
Jeff Bailey Pending
Review via email: mp+41191@code.launchpad.net

Description of the change

Sorry, I'd like to propose this for 'upstream' but didn't see
a mailing list to send a patch to. Please let me know if you'd
like me to send it elsewhere/differently.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Upstream is Debian; perhaps you could file a Debian bug report on
initramfs-tools with this patch?

A poll/retry loop is generally a suboptimal way to do this kind of
thing; what we really want is to wait for udev to tell us that it has
finished with the event that triggered renaming of the device. Perhaps
you could talk with Surbhi about the plans for making the initramfs more
event-based.

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

Quoting Colin Watson (<email address hidden>):
> Upstream is Debian; perhaps you could file a Debian bug report on
> initramfs-tools with this patch?

Will do.

> A poll/retry loop is generally a suboptimal way to do this kind of
> thing; what we really want is to wait for udev to tell us that it has
> finished with the event that triggered renaming of the device. Perhaps
> you could talk with Surbhi about the plans for making the initramfs more
> event-based.

Gladly - on which mailing list should I talk to Surbhi?

thanks,
-serge

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm sure private mail would be fine. (LP user csurbhi)

Revision history for this message
Jeff Bailey (jbailey) wrote :

Thanks, Colin.

Is there anything I should do to keep people from looking at the launchpad
project?

On Thu, Nov 18, 2010 at 11:46 AM, Colin Watson <email address hidden>wrote:

> Upstream is Debian; perhaps you could file a Debian bug report on
> initramfs-tools with this patch?
>
> A poll/retry loop is generally a suboptimal way to do this kind of
> thing; what we really want is to wait for udev to tell us that it has
> finished with the event that triggered renaming of the device. Perhaps
> you could talk with Surbhi about the plans for making the initramfs more
> event-based.
> --
>
> https://code.launchpad.net/~serge-hallyn/ubuntu/natty/initramfs-tools/retrymount/+merge/41191
> You are requested to review the proposed merge of
> lp:~serge-hallyn/ubuntu/natty/initramfs-tools/retrymount into
> lp:ubuntu/initramfs-tools.
>

--
Jeff Bailey - http://www.raspberryginger.com/jbailey/
"This specification should be read like all other specifications. First, it
should be read cover-to-cover, multiple times. Then, it should be read
backwards at least once. Then it should be read by picking random sections
from the contents list and following all the cross-references."
 - HTML5

Unmerged revisions

230. By Serge Hallyn

Add retries to mountroot(). This is particularly needed when we
use multipath, because 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.

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-10-06 17:53:20 +0000
3+++ debian/changelog 2010-11-18 16:27:43 +0000
4@@ -1,3 +1,14 @@
5+initramfs-tools (0.98.1ubuntu8) natty; urgency=low
6+
7+ * Add retries to mountroot(). This is particularly needed when we
8+ use multipath, because it is possible that mountroot() will race
9+ with udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from
10+ /dev/sd?? to /dev/mapper/something. After multipath has grabbed
11+ the /dev/sd?? and until udev completes the rename, mounting
12+ /dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY.
13+
14+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Thu, 18 Nov 2010 10:11:48 -0600
15+
16 initramfs-tools (0.98.1ubuntu7) natty; urgency=low
17
18 * mdadm autoassembly works by matching hostname with what is stored in the
19
20=== modified file 'scripts/local'
21--- scripts/local 2010-07-05 11:52:28 +0000
22+++ scripts/local 2010-11-18 16:27:43 +0000
23@@ -86,10 +86,19 @@
24 # FIXME This has no error checking
25 [ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
26
27- # FIXME This has no error checking
28 # Mount root
29- mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
30- mountroot_status="$?"
31+ tries=0
32+ ret=1
33+ while [ $tries -lt 10 -a $ret -ne 0 ]; do
34+ mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
35+ ret=$?
36+ if [ $ret -ne 0 ]; then
37+ echo "failed attempt $tries to mount $ROOT as root"
38+ sleep 1
39+ tries=$((tries+1))
40+ fi
41+ done
42+ mountroot_status=$ret
43 if [ "$LOOP" ]; then
44 if [ "$mountroot_status" != 0 ]; then
45 if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then

Subscribers

People subscribed via source and target branches

to all changes: