Hello community,
here is the log from the commit of package util-linux
checked in at Tue Dec 2 15:41:49 CET 2008.
--------
--- util-linux/util-linux.changes 2008-11-27 11:41:41.000000000 +0100
+++ /mounts/work_src_done/STABLE/util-linux/util-linux.changes 2008-12-02 12:24:45.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Dec 2 12:23:37 CET 2008 - mkoenig@suse.de
+
+- raw: do not stat the raw devices when binding, since they
+ are created dynamically [bnc#450675]
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
util-linux-2.14.1-disk_utils_raw_should_use_ioctl_to_create_device.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ util-linux.spec ++++++
--- /var/tmp/diff_new_pack.A30632/_old 2008-12-02 15:40:46.000000000 +0100
+++ /var/tmp/diff_new_pack.A30632/_new 2008-12-02 15:40:46.000000000 +0100
@@ -30,7 +30,7 @@
Group: System/Base
AutoReqProv: on
Version: 2.14.1
-Release: 9
+Release: 10
Requires: %name-lang = %{version}
Summary: A collection of basic system utilities
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2
@@ -85,8 +85,9 @@
Patch17: util-linux-2.14.1-mount_race.patch
Patch18: util-linux-2.14.1-mount_skip_sync.patch
Patch19: util-linux-2.14.1-hwclock_adjust_and_hctosys.patch
+Patch20: util-linux-2.14.1-disk_utils_raw_should_use_ioctl_to_create_device.patch
# crypto patch
-Patch20: util-linux-mount_losetup_crypto.patch
+Patch30: util-linux-mount_losetup_crypto.patch
##
##
## adjtimex
@@ -142,6 +143,7 @@
%patch18 -p1
%patch19 -p1
%patch20 -p1
+%patch30 -p1
cp %{SOURCE7} %{SOURCE8} .
#
cd adjtimex-*
@@ -611,6 +613,9 @@
#%endif
%changelog
+* Tue Dec 02 2008 mkoenig@suse.de
+- raw: do not stat the raw devices when binding, since they
+ are created dynamically [bnc#450675]
* Thu Nov 27 2008 dmueller@suse.de
- mount: fix hang on trying to find a free loop device
if one of them has a stale nfs handle mounted (bnc#449646)
++++++ util-linux-2.14.1-disk_utils_raw_should_use_ioctl_to_create_device.patch ++++++
From: Jeff Mahoney
Subject: [PATCH] raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
References: bnc#450675
The in-kernel ioctl code creates a raw# device on-demand. udev will create
the /dev/raw/raw# file when the device is created automatically.
The current raw userspace code wants to stat the file before using it,
which is unnecessary for setting up the raw device.
This patch stats the file only when query() is called as a singleton, and
it's doubtful it's needed even there. I modified as little code as I could,
though.
Without this patch raw devices WILL NOT WORK on SLE11.
Signed-off-by: Jeff Mahoney
---
disk-utils/raw.c | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -41,7 +41,7 @@ int master_fd;
int raw_minor;
void open_raw_ctl(void);
-int query(int minor, int quiet);
+int query(int minor, const char *raw_name, int quiet);
int bind (int minor, int block_major, int block_minor);
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
if (optind < argc)
usage(1);
for (i = 1; i < RAW_NR_MINORS; i++)
- query(i, 1);
+ query(i, NULL, 1);
exit(0);
}
@@ -122,28 +122,8 @@ int main(int argc, char *argv[])
exit(2);
}
- err = stat(raw_name, &statbuf);
- if (err) {
- fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
- raw_name, strerror(errno));
- exit(2);
- }
-
- if (!S_ISCHR(statbuf.st_mode)) {
- fprintf (stderr, "Raw device '%s' is not a character dev\n",
- raw_name);
- exit(2);
- }
- if (major(statbuf.st_rdev) != RAW_MAJOR) {
- fprintf (stderr, "Device '%s' is not a raw dev\n",
- raw_name);
- exit(2);
- }
-
- raw_minor = minor(statbuf.st_rdev);
-
if (do_query)
- return query(raw_minor, 0);
+ return query(raw_minor, raw_name, 0);
/*
* It's not a query, so we still have some parsing to do. Have
@@ -205,13 +185,35 @@ void open_raw_ctl(void)
}
}
-int query(int minor, int quiet)
+int query(int raw_minor, const char *raw_name, int quiet)
{
struct raw_config_request rq;
static int has_worked = 0;
int err;
+ struct stat statbuf;
+
+ if (raw_name) {
+ err = stat(raw_name, &statbuf);
+ if (err) {
+ fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
+ raw_name, strerror(errno));
+ exit(2);
+ }
+
+ if (!S_ISCHR(statbuf.st_mode)) {
+ fprintf (stderr, "Raw device '%s' is not a character dev\n",
+ raw_name);
+ exit(2);
+ }
+ if (major(statbuf.st_rdev) != RAW_MAJOR) {
+ fprintf (stderr, "Device '%s' is not a raw dev\n",
+ raw_name);
+ exit(2);
+ }
+ raw_minor = minor(statbuf.st_rdev);
+ }
- rq.raw_minor = minor;
+ rq.raw_minor = raw_minor;
err = ioctl(master_fd, RAW_GETBIND, &rq);
if (err < 0) {
if (quiet && errno == ENODEV)
@@ -230,7 +232,7 @@ int query(int minor, int quiet)
if (quiet && !rq.block_major && !rq.block_minor)
return 0;
printf (RAWDEVDIR "raw%d: bound to major %d, minor %d\n",
- minor, (int) rq.block_major, (int) rq.block_minor);
+ raw_minor, (int) rq.block_major, (int) rq.block_minor);
return 0;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org