rpms/util-linux/FC-6 util-linux-2.13-blockdev-errno.patch, NONE, 1.1 util-linux-2.13-blockdev-unsigned.patch, NONE, 1.1 util-linux.spec, 1.154, 1.155

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Aug 2 11:53:13 UTC 2007


Author: kzak

Update of /cvs/dist/rpms/util-linux/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv29767

Modified Files:
	util-linux.spec 
Added Files:
	util-linux-2.13-blockdev-errno.patch 
	util-linux-2.13-blockdev-unsigned.patch 
Log Message:
* Thu Aug  2 2007 Karel Zak <kzak at redhat.com>  2.13-0.48
- fix #238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors


util-linux-2.13-blockdev-errno.patch:
 blockdev.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

--- NEW FILE util-linux-2.13-blockdev-errno.patch ---
--- util-linux-2.13-pre7/disk-utils/blockdev.c.kzak	2007-08-02 13:43:16.000000000 +0200
+++ util-linux-2.13-pre7/disk-utils/blockdev.c	2007-08-02 13:43:16.000000000 +0200
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
+#include <errno.h>
 
 #include "nls.h"
 
@@ -160,8 +161,10 @@
 	long long b;
 
 	err = ioctl (fd, BLKGETSIZE, &sz);
-	if (err)
-		return err;
+	if (err) {
+		if (errno != EFBIG)
+			return err;
+	}
 	err = ioctl(fd, BLKGETSIZE64, &b);
 	if (err || b == 0 || b == sz)
 		*sectors = sz;

util-linux-2.13-blockdev-unsigned.patch:
 blockdev.c |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

--- NEW FILE util-linux-2.13-blockdev-unsigned.patch ---
--- util-linux-2.13-pre7/disk-utils/blockdev.c.kzak	2007-08-02 13:24:45.000000000 +0200
+++ util-linux-2.13-pre7/disk-utils/blockdev.c	2007-08-02 13:24:45.000000000 +0200
@@ -77,6 +77,8 @@
 #define ARGINTG	4
 #define ARGLINTG 5
 #define ARGLLINTG 6
+#define ARGLU 7
+#define ARGLLU 8
 	long argval;
 	char *argname;
 	char *help;
@@ -98,10 +100,10 @@
 	{ "--setbsz", "BLKBSZSET", BLKBSZSET, ARGINTAP, 0, "BLOCKSIZE", N_("set blocksize") },
 #endif
 #ifdef BLKGETSIZE
-	{ "--getsize", "BLKGETSIZE", BLKGETSIZE, ARGLINTG, -1, NULL, N_("get 32-bit sector count") },
+	{ "--getsize", "BLKGETSIZE", BLKGETSIZE, ARGLU, -1, NULL, N_("get 32-bit sector count") },
 #endif
 #ifdef BLKGETSIZE64
-	{ "--getsize64", "BLKGETSIZE64", BLKGETSIZE64, ARGLLINTG, -1, NULL, N_("get size in bytes") },
+	{ "--getsize64", "BLKGETSIZE64", BLKGETSIZE64, ARGLLU, -1, NULL, N_("get size in bytes") },
 #endif
 #ifdef BLKRASET
 	{ "--setra", "BLKRASET", BLKRASET, ARGINTA, 0, "READAHEAD", N_("set readahead") },
@@ -286,6 +288,8 @@
 	int iarg;
 	long larg;
 	long long llarg;
+	unsigned long lu;
+	unsigned long long llu;
 	int verbose = 0;
 
 	for (i = 1; i < d; i++) {
@@ -363,6 +367,15 @@
 			llarg = bdcms[j].argval;
 			res = ioctl(fd, bdcms[j].ioc, &llarg);
 			break;
+		case ARGLU:
+			lu = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &lu);
+			break;
+		case ARGLLU:
+			llu = bdcms[j].argval;
+			res = ioctl(fd, bdcms[j].ioc, &llu);
+			break;
+
 		}
 		if (res == -1) {
 			perror(bdcms[j].iocname);
@@ -389,6 +402,19 @@
 			else
 				printf("%lld\n", llarg);
 			break;
+		case ARGLU:
+			if (verbose)
+				printf("%s: %lu\n", _(bdcms[j].help), lu);
+			else
+				printf("%lu\n", lu);
+			break;
+		case ARGLLU:
+			if (verbose)
+				printf("%s: %llu\n", _(bdcms[j].help), llu);
+			else
+				printf("%llu\n", llu);
+			break;
+
 		default:
 			if (verbose)
 				printf(_("%s succeeded.\n"), _(bdcms[j].help));


Index: util-linux.spec
===================================================================
RCS file: /cvs/dist/rpms/util-linux/FC-6/util-linux.spec,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -r1.154 -r1.155
--- util-linux.spec	2 Aug 2007 10:29:52 -0000	1.154
+++ util-linux.spec	2 Aug 2007 11:53:10 -0000	1.155
@@ -9,7 +9,7 @@
 Summary: A collection of basic system utilities.
 Name: util-linux
 Version: 2.13
-Release: 0.47%{?dist}
+Release: 0.48%{?dist}
 License: distributable
 Group: System Environment/Base
 
@@ -234,6 +234,9 @@
 Patch266: util-linux-2.13-sfdisk-geo.patch
 # 217186 - /bin/sh: @MKINSTALLDIRS@: No such file or directory
 Patch267: util-linux-2.13-mkdir_p.patch
+# 238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors
+Patch268: util-linux-2.13-blockdev-errno.patch
+Patch269: util-linux-2.13-blockdev-unsigned.patch
 
 %description
 The util-linux package contains a large variety of low-level system
@@ -330,6 +333,8 @@
 %patch265 -p1
 %patch266 -p1
 %patch267 -p1
+%patch268 -p1
+%patch269 -p1
 
 %build
 unset LINGUAS || :
@@ -721,6 +726,9 @@
 /sbin/losetup
 
 %changelog
+* Thu Aug  2 2007 Karel Zak <kzak at redhat.com>  2.13-0.48
+- fix #238918 - blockdev --getsize does not work properly on devices with more than 2^31 sectors
+
 * Thu Aug  2 2007 Karel Zak <kzak at redhat.com>  2.13-0.47
 - fix #236848 - mount/fstab.c:lock_mtab() should open with proper permissions
 - fix #213253 - "cal -3" generates improperly formatted output




More information about the fedora-cvs-commits mailing list