[Frugalware-git] frugalware-current: util-linux-ng-2.15-4-i686

Miklos Vajna vmiklos at frugalware.org
Wed May 20 23:32:02 CEST 2009


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=873696f84df5370efdb5aa35068b894e2119107d

commit 873696f84df5370efdb5aa35068b894e2119107d
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Wed May 20 23:31:43 2009 +0200

util-linux-ng-2.15-4-i686

- backported two patches from git
- partially closes #3783

diff --git a/source/base/util-linux-ng/0001-blkid-fix-hangs-forever-with-partition-type-mdraid.patch b/source/base/util-linux-ng/0001-blkid-fix-hangs-forever-with-partition-type-mdraid.patch
new file mode 100644
index 0000000..6a12532
--- /dev/null
+++ b/source/base/util-linux-ng/0001-blkid-fix-hangs-forever-with-partition-type-mdraid.patch
@@ -0,0 +1,131 @@
+From 4ce48a971d322cc1f690dd036f906fc54261c657 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak at redhat.com>
+Date: Thu, 14 May 2009 18:04:55 +0200
+Subject: [PATCH] blkid: fix "hangs forever with partition type mdraid"
+
+> #:> blkid /dev/sda7
+> /dev/sda7: UUID="c193d159-1fd4-1a4b-4037-f3433e016f3d" TYPE="mdraid"
+>
+> The blkid binary build from the util-linux-ng sources just hangs
+> forever with 100% cpu load with the same command.
+
+Reported-by: Juergen Daubert <jue at jue.li>
+Signed-off-by: Karel Zak <kzak at redhat.com>
+---
+ shlibs/blkid/src/probe.c |   28 +++++++++++++++-------------
+ 1 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
+index 0e4745a..b0c0be8 100644
+--- a/libs/blkid/src/probe.c
++++ b/libs/blkid/src/probe.c
+@@ -160,6 +160,11 @@ static void blkid_probe_reset_vals(blkid_probe pr)
+ 	pr->nvals = 0;
+ }
+
++static void blkid_probe_reset_idx(blkid_probe pr)
++{
++	pr->idx = -1;
++}
++
+ void blkid_reset_probe(blkid_probe pr)
+ {
+ 	if (!pr)
+@@ -169,14 +174,13 @@ void blkid_reset_probe(blkid_probe pr)
+ 		memset(pr->buf, 0, pr->buf_max);
+ 	pr->buf_off = 0;
+ 	pr->buf_len = 0;
+-	pr->idx = 0;
+ 	if (pr->sbbuf)
+ 		memset(pr->sbbuf, 0, BLKID_SB_BUFSIZ);
+ 	pr->sbbuf_len = 0;
+ 	blkid_probe_reset_vals(pr);
++	blkid_probe_reset_idx(pr);
+ }
+
+-
+ /*
+  * Note that we have two offsets:
+  *
+@@ -263,7 +267,6 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
+ 	pr->fd = fd;
+ 	pr->off = off;
+ 	pr->size = 0;
+-	pr->idx = 0;
+
+ 	if (size)
+ 		pr->size = size;
+@@ -307,7 +310,7 @@ int blkid_probe_reset_filter(blkid_probe pr)
+ 		return -1;
+ 	if (pr->fltr)
+ 		memset(pr->fltr, 0, BLKID_FLTR_SIZE * sizeof(unsigned long));
+-	pr->idx = 0;
++	blkid_probe_reset_idx(pr);
+ 	return 0;
+ }
+
+@@ -324,9 +327,10 @@ int blkid_probe_filter_types(blkid_probe pr, int flag, char *names[])
+
+ 	if (!pr || !names)
+ 		return -1;
+-	if (!pr->fltr)
++	if (!pr->fltr) {
+ 		pr->fltr = calloc(BLKID_FLTR_SIZE, sizeof(unsigned long));
+-	else
++		blkid_probe_reset_idx(pr);
++	} else
+ 		blkid_probe_reset_filter(pr);
+
+ 	if (!pr->fltr)
+@@ -355,7 +359,6 @@ int blkid_probe_filter_types(blkid_probe pr, int flag, char *names[])
+ 		}
+ 	}
+ 	DBG(DEBUG_LOWPROBE, printf("a new probing type-filter initialized\n"));
+-	pr->idx = 0;
+ 	return 0;
+ }
+
+@@ -375,9 +378,10 @@ int blkid_probe_filter_usage(blkid_probe pr, int flag, int usage)
+
+ 	if (!pr || !usage)
+ 		return -1;
+-	if (!pr->fltr)
++	if (!pr->fltr) {
+ 		pr->fltr = calloc(BLKID_FLTR_SIZE, sizeof(unsigned long));
+-	else
++		blkid_probe_reset_idx(pr);
++	} else
+ 		blkid_probe_reset_filter(pr);
+
+ 	if (!pr->fltr)
+@@ -393,7 +397,6 @@ int blkid_probe_filter_usage(blkid_probe pr, int flag, int usage)
+ 			blkid_bmp_set_item(pr->fltr, i);
+ 	}
+ 	DBG(DEBUG_LOWPROBE, printf("a new probing usage-filter initialized\n"));
+-	pr->idx = 0;
+ 	return 0;
+ }
+
+@@ -407,8 +410,8 @@ int blkid_probe_invert_filter(blkid_probe pr)
+ 	for (i = 0; i < BLKID_FLTR_SIZE; i++)
+ 		pr->fltr[i] = ~pr->fltr[i];
+
++	blkid_probe_reset_idx(pr);
+ 	DBG(DEBUG_LOWPROBE, printf("probing filter inverted\n"));
+-	pr->idx = 0;
+ 	return 0;
+ }
+
+@@ -455,8 +458,7 @@ int blkid_do_probe(blkid_probe pr)
+
+ 	blkid_probe_reset_vals(pr);
+
+-	if (pr->idx)
+-		i = pr->idx + 1;
++	i = pr->idx + 1;
+
+ 	if (i < 0 && i >= ARRAY_SIZE(idinfos))
+ 		return -1;
+--
+1.6.2.5
+
diff --git a/source/base/util-linux-ng/0002-blkid-blkid_do_safeprobe-has-to-be-tolerant-to-RA.patch b/source/base/util-linux-ng/0002-blkid-blkid_do_safeprobe-has-to-be-tolerant-to-RA.patch
new file mode 100644
index 0000000..581faa2
--- /dev/null
+++ b/source/base/util-linux-ng/0002-blkid-blkid_do_safeprobe-has-to-be-tolerant-to-RA.patch
@@ -0,0 +1,46 @@
+From 7103157c8bbf37a56c7c385198267120f72b7866 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak at redhat.com>
+Date: Thu, 14 May 2009 18:29:03 +0200
+Subject: [PATCH] blkid: blkid_do_safeprobe() has to be tolerant to RAIDs
+
+It's pretty generic that RAID signature is on the same device as FS
+signature. We have to be tolerant and ignore filesystems signatures
+on such devices. The RAID signature is always preferred.
+
+Signed-off-by: Karel Zak <kzak at redhat.com>
+---
+ shlibs/blkid/src/probe.c |    9 ++++++++-
+ 1 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
+index b0c0be8..af22e34 100644
+--- a/libs/blkid/src/probe.c
++++ b/libs/blkid/src/probe.c
+@@ -529,6 +529,10 @@ int blkid_do_probe(blkid_probe pr)
+  * This is the same function as blkid_do_probe(), but returns only one result
+  * (cannot be used in while()) and checks for ambivalen results (more
+  * filesystems on the device) -- in such case returns -2.
++ *
++ * The function does not check for filesystems when a RAID signature is
++ * detected.  The function also does not check for collision between RAIDs. The
++ * first detected RAID is returned.
+  */
+ int blkid_do_safeprobe(blkid_probe pr)
+ {
+@@ -544,9 +548,12 @@ int blkid_do_safeprobe(blkid_probe pr)
+ 			first.nvals = pr->nvals;
+ 			first.idx = pr->idx;
+ 		}
++		count++;
++
++		if (idinfos[pr->idx]->usage & BLKID_USAGE_RAID)
++			break;
+ 		if (!(idinfos[pr->idx]->flags & BLKID_IDINFO_TOLERANT))
+ 			intol++;
+-		count++;
+ 	}
+ 	if (rc < 0)
+ 		return rc;		/* error */
+--
+1.6.2.5
+
diff --git a/source/base/util-linux-ng/FrugalBuild b/source/base/util-linux-ng/FrugalBuild
index a417fba..ba1144a 100644
--- a/source/base/util-linux-ng/FrugalBuild
+++ b/source/base/util-linux-ng/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=util-linux-ng
pkgver=2.15
-pkgrel=3
+pkgrel=4
pkgdesc="Miscellaneous system utilities for Linux"
url="http://www.kernel.org/pub/linux/utils/util-linux-ng"
backup=('etc/sysconfig/console' 'etc/sysconfig/numlock')
@@ -18,8 +18,10 @@ source=($url/v2.15/util-linux-ng-$pkgver.tar.bz2 \
frugalwaregetty numlock rc.{bootclean,console,mount,rmount,swap,time} \
rc.bootclean-{de,hu}.po rc.mount-{de,hu}.po rc.rmount-{de,hu}.po \
rc.swap-{de,hu}.po rc.time-{de,hu}.po \
-	README.Frugalware)
-signatures=($source.sign '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
+	README.Frugalware \
+	0001-blkid-fix-hangs-forever-with-partition-type-mdraid.patch \
+	0002-blkid-blkid_do_safeprobe-has-to-be-tolerant-to-RA.patch)
+signatures=($source.sign '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')

# NOTE for porters: first you'll have to build this pkg without
# e2fsprogs, build e2fsprogs against u-l-ng, then rebuild u-l-ng with


More information about the Frugalware-git mailing list