rpms/mkinitrd/F-10 mkinitrd-6.0.71-480667.patch, NONE, 1.1 mkinitrd-6.0.71-do-not-use-resolve_dm_name.patch, NONE, 1.1 mkinitrd-6.0.71-relatime.patch, NONE, 1.1 mkinitrd.spec, 1.297, 1.298

Hans de Goede jwrdegoede at fedoraproject.org
Thu Feb 12 10:42:22 UTC 2009


Author: jwrdegoede

Update of /cvs/extras/rpms/mkinitrd/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3272

Modified Files:
	mkinitrd.spec 
Added Files:
	mkinitrd-6.0.71-480667.patch 
	mkinitrd-6.0.71-do-not-use-resolve_dm_name.patch 
	mkinitrd-6.0.71-relatime.patch 
Log Message:
* Thu Feb 12 2009 Hans de Goede <hdegoede at redhat.com> - 6.0.71-4
- Do not call dm_resolve_name on dmraidsets names, sometimes it fails, and
  it is not necessary, this fixes the dmraid boot failure seen on
  some systems (#476818)
- Fix finding / by UUID or LABEL not working with newer kernels (#480667)
- Fix mkinitrd not supporting relatime fstab option for / (#296361)


mkinitrd-6.0.71-480667.patch:

--- NEW FILE mkinitrd-6.0.71-480667.patch ---
From: Hans de Goede <hdegoede at redhat.com>
Date: Wed, 4 Feb 2009 20:13:34 +0000 (+0100)
Subject: FIX: nash unable to find dm devs by uuid or label (#480667)
X-Git-Tag: 6.0.76-1~3
X-Git-Url: http://git.fedorahosted.org/git/?p=mkinitrd;a=commitdiff_plain;h=c6d2fed59cec24e298aa35ca93fd7d33c1d92549

FIX: nash unable to find dm devs by uuid or label (#480667)

There was some ambigity in the return value of nashGetUEventPoll() causing
problems when getting events with a timeout of 0 (a timeout would be seen when
no timeout has happened). This patch fixes this, thereby fixing #480667.
---

diff --git a/nash/block.c b/nash/block.c
index 809e0ff..d9eea72 100644
--- a/nash/block.c
+++ b/nash/block.c
@@ -280,20 +280,20 @@ static int block_process_one_uevent(nashContext *nc,
     struct nash_dev_node *node = NULL;
     nashUEvent uevent;
     struct nash_block_dev *dev = NULL;
-    int rc = -1;
+    int rc;
+
+    if (nodep)
+        *nodep = NULL;
 
     memset(&uevent, '\0', sizeof (uevent));
 
-    if (nashGetUEvent(nc, timeout, &uevent) < 0)
-        return -1;
-    if (!uevent.msg)
-        return 0;
+    if ((rc = nashGetUEvent(nc, timeout, &uevent)) <= 0)
+        return rc;
 
-    rc = 0;
     if (block_try_uevent(nc, &uevent, &dev) >= 0) {
         node = nash_dev_tree_process_bdev(nc, dev);
-        *nodep = node;
-        rc = 1;
+        if (nodep)
+            *nodep = node;
     }
     if (uevent.msg)
         free(uevent.msg);
@@ -306,13 +306,11 @@ static int block_process_one_uevent(nashContext *nc,
 
 static void block_process_pending_uevents(nashContext *nc)
 {
-    struct nash_dev_node *node;
     struct timespec timeout;
 
     do {
         usectospec(1, &timeout);
-        node = NULL;
-    } while (block_process_one_uevent(nc, &timeout, &node) >= 0 && node);
+    } while (block_process_one_uevent(nc, &timeout, NULL) > 0);
 }
 
 nashBdevIter
@@ -366,6 +364,7 @@ nashBdevIterNext(nashBdevIter *iterp, struct nash_block_dev **dev)
 {
     nashBdevIter iter;
     struct timespec timeout;
+    int rc;
 
     if (!iterp || !*iterp)
         return 0;
@@ -393,12 +392,12 @@ nashBdevIterNext(nashBdevIter *iterp, struct nash_block_dev **dev)
                 continue;
             case POLLING:
                 timeout = iter->timeout;
-                if (block_process_one_uevent(iter->nc, &timeout, &node) > 0
-                        && node) {
+                rc = block_process_one_uevent(iter->nc, &timeout, &node);
+                if (rc > 0 && node) {
                     *dev = node->bdev;
                     return 1;
                 }
-                if (speczero(&timeout))
+                if (rc <= 0)
                     iter->state = DONE;
                 continue;
             case DONE:
diff --git a/nash/hotplug.c b/nash/hotplug.c
index 5b5836e..9111021 100644
--- a/nash/hotplug.c
+++ b/nash/hotplug.c
@@ -482,22 +482,22 @@ handle_events(nashContext *nc)
     };
     int doexit = 0;
 
-    memset(&uevent, '\0', sizeof (uevent));
-
     while (1) {
         usectospec(-1, &timeout);
+        memset(&uevent, '\0', sizeof (uevent));
         ret = nashGetUEventPoll(nc, &timeout, &uevent, &pd, 1);
         if (doexit || ret < 0)
             break;
 
-        seqnum = handle_single_uevent(nc, &uevent, seqnum);
-        if (uevent.msg)
-            free(uevent.msg);
-        if (uevent.path)
-            free(uevent.path);
-        while (uevent.envz)
-            argz_delete(&uevent.envz, &uevent.envz_len, uevent.envz);
-        memset(&uevent, '\0', sizeof (uevent));
+        if (ret) {
+            seqnum = handle_single_uevent(nc, &uevent, seqnum);
+            if (uevent.msg)
+                free(uevent.msg);
+            if (uevent.path)
+                free(uevent.path);
+            while (uevent.envz)
+                argz_delete(&uevent.envz, &uevent.envz_len, uevent.envz);
+        }
 
         if (pd.revents) {
             char buf[32] = {'\0'};
diff --git a/nash/uevent.c b/nash/uevent.c
index 2e0476e..a05bd98 100644
--- a/nash/uevent.c
+++ b/nash/uevent.c
@@ -175,8 +175,15 @@ err:
 }
 
 /*
- * Minor dragon here -- success is return of >= 0; timeout is return of
- * 0 and speczero(timeout).
+ * Note the return value only indicates if an uevent was gotten or not, to
+ * check the status of the (optional) additional pollfd's passed in check their
+ * revent members (which must be cleared to 0 by the caller beforehand)
+ *
+ * Return value
+ * < 0: error
+ * 0: timeout or woken up because of events on the additional pollfd's to
+ *    monitor (iow we did not get an uevent)
+ * 1: We got an uevent and stored it in the uevent parameter
  */
 int 
 nashGetUEventPoll(nashContext *nc, struct timespec *timeout,
@@ -203,12 +210,16 @@ nashGetUEventPoll(nashContext *nc, struct timespec *timeout,
 
     if (rc > 0) {
         int i;
+
+        rc = 0;
         for (i = 0; i <= npfds; i++) {
             if (pds[i].fd == handler->socket && pds[i].revents) {
                 if (get_netlink_msg(handler->socket, uevent) < 0) {
+                    errnum = errno;
                     nashLogger(nc, NASH_ERROR, "get_netlink_msg returned %m\n");
-                }
-                rc--;
+                    rc = -1;
+                } else
+                    rc = 1;
             }
         }
         if (npfds)

mkinitrd-6.0.71-do-not-use-resolve_dm_name.patch:

--- NEW FILE mkinitrd-6.0.71-do-not-use-resolve_dm_name.patch ---
diff -up mkinitrd-6.0.71/mkinitrd~ mkinitrd-6.0.71/mkinitrd
--- mkinitrd-6.0.71/mkinitrd~	2009-02-03 11:20:01.000000000 +0100
+++ mkinitrd-6.0.71/mkinitrd	2009-02-03 11:25:15.000000000 +0100
@@ -1204,8 +1204,7 @@ if [ -n "$testdm" \
                 *)
                     for raid in $RAIDS ; do
                         if [ "$raid" == "$NAME" ]; then
-                            dmname=$(resolve_dm_name $NAME)
-                            DMDEVS="$DMDEVS $dmname"
+                            DMDEVS="$DMDEVS $NAME"
                             RAIDS=$(sed 's/ $NAME //' <<< "$RAIDS")
                             break
                         fi

mkinitrd-6.0.71-relatime.patch:

--- NEW FILE mkinitrd-6.0.71-relatime.patch ---
diff -udr mkinitrd-6.0.71.orig/nash/nash.c mkinitrd-6.0.71/nash/nash.c
--- mkinitrd-6.0.71.orig/nash/nash.c	2008-11-12 13:02:43.000000000 -0600
+++ mkinitrd-6.0.71/nash/nash.c	2009-01-04 17:33:07.030123167 -0600
@@ -58,6 +58,7 @@
 #include <sched.h>
 
 #include <asm/unistd.h>
+#include <linux/fs.h>
 
 #include <libdevmapper.h>
 
@@ -103,18 +104,6 @@
 #define RAID_AUTORUN           _IO (MD_MAJOR, 0x14)
 #endif
 
-#ifndef MS_REMOUNT
-#define MS_REMOUNT      32
-#endif
-
-#ifndef MS_BIND
-#define MS_BIND 4096
-#endif
-
-#ifndef MS_MOVE
-#define MS_MOVE 8192
-#endif
-
 #ifndef MNT_FORCE
 #define MNT_FORCE 0x1
 #endif
@@ -452,6 +441,10 @@
                 flags |= MS_NOATIME;
             else if (!strcmp(start, "atime"))
                 flags &= ~MS_NOATIME;
+            else if (!strcmp(start, "relatime"))
+                flags |= MS_RELATIME;
+            else if (!strcmp(start, "norelatime"))
+                flags &= ~MS_RELATIME;
             else if (!strcmp(start, "remount"))
                 flags |= MS_REMOUNT;
             else if (!strcmp(start, "bind"))
@@ -482,7 +475,7 @@
     }
 
     if (_nash_context->testing) {
-        printf("mount %s%s%s-t '%s' '%s' '%s' (%s%s%s%s%s%s%s)\n",
+        printf("mount %s%s%s-t '%s' '%s' '%s' (%s%s%s%s%s%s%s%s)\n",
                 opts ? "-o '" : "",
                 opts ? opts : "",
                 opts ? "\' " : "",
@@ -493,7 +486,8 @@
                 (flags & MS_NOEXEC) ? "noexec " : "",
                 (flags & MS_SYNCHRONOUS) ? "sync " : "",
                 (flags & MS_REMOUNT) ? "remount " : "",
-                (flags & MS_NOATIME) ? "noatime " : ""
+                (flags & MS_NOATIME) ? "noatime " : "",
+                (flags & MS_RELATIME) ? "relatime " : ""
             );
     } else {
         char *mount_opts = NULL;


Index: mkinitrd.spec
===================================================================
RCS file: /cvs/extras/rpms/mkinitrd/F-10/mkinitrd.spec,v
retrieving revision 1.297
retrieving revision 1.298
diff -u -r1.297 -r1.298
--- mkinitrd.spec	8 Dec 2008 18:40:36 -0000	1.297
+++ mkinitrd.spec	12 Feb 2009 10:41:51 -0000	1.298
@@ -3,13 +3,16 @@
 Summary: Creates an initial ramdisk image for preloading modules.
 Name: mkinitrd
 Version: 6.0.71
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: mkinitrd-%{version}.tar.bz2
-# This patch is in 6.0.73, but we don't want the more bleeding edge libdhcp ->
-# dhclient changes also in there.
+# These patches are in newer mkinitrd's, but we don't want the more bleeding
+# edge libdhcp -> dhclient changes also in there.
 Patch0: mkinitrd-6.0.71-scsi_wait_scan.patch
+Patch1: mkinitrd-6.0.71-do-not-use-resolve_dm_name.patch
+Patch2: mkinitrd-6.0.71-480667.patch
+Patch3: mkinitrd-6.0.71-relatime.patch
 ExclusiveOs: Linux
 URL: git://git.fedoraproject.org/git/hosted/mkinitrd
 Requires: /bin/sh, /sbin/insmod.static, /sbin/losetup
@@ -70,6 +73,9 @@
 %prep
 %setup -q -n mkinitrd-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 find . -name "Makefile*" -exec sed -i 's|-Werror||g' {} \;
 
 %build
@@ -124,6 +130,13 @@
 %dir %{_sysconfdir}/kernel/prerm.d
 
 %changelog
+* Thu Feb 12 2009 Hans de Goede <hdegoede at redhat.com> - 6.0.71-4
+- Do not call dm_resolve_name on dmraidsets names, sometimes it fails, and
+  it is not necessary, this fixes the dmraid boot failure seen on
+  some systems (#476818)
+- Fix finding / by UUID or LABEL not working with newer kernels (#480667)
+- Fix mkinitrd not supporting relatime fstab option for / (#296361)
+
 * Mon Dec  8 2008 Hans de Goede <hdegoede at redhat.com> - 6.0.71-3
 - Use scsi_wait_scan on scsi devices instead of stabilized (#470628)
 




More information about the fedora-extras-commits mailing list