diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-12-17 19:44:48 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-12-17 19:44:48 +0000 |
commit | a1221fd0aef2246657112f616cb2ff5b13726758 (patch) | |
tree | 0d3ff5e92b3b9c48faa32f4c1aa929f5a1a01bcc /sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch | |
parent | New version. (diff) | |
download | gentoo-2-a1221fd0aef2246657112f616cb2ff5b13726758.tar.gz gentoo-2-a1221fd0aef2246657112f616cb2ff5b13726758.tar.bz2 gentoo-2-a1221fd0aef2246657112f616cb2ff5b13726758.zip |
New version.
Diffstat (limited to 'sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch')
-rw-r--r-- | sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch b/sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch new file mode 100644 index 000000000000..2cfc6e4af4e8 --- /dev/null +++ b/sys-fs/udev/files/udev-009-scsi_id-new-sysfs.patch @@ -0,0 +1,108 @@ +From linux-kernel-owner@vger.kernel.org Wed Dec 17 20:39:13 2003 +Return-Path: <linux-kernel-owner+azarah=40nosferatu.za.org@vger.kernel.org> +X-Original-To: azarah@nosferatu.za.org +Delivered-To: azarah@nosferatu.za.org +Received: by gateway.lan (Postfix, from userid 290) id 1028C32415; Wed, 17 + Dec 2003 20:39:13 +0200 (SAST) +Received: from vger.kernel.org (vger.kernel.org [67.72.78.212]) by + gateway.lan (Postfix) with ESMTP id A53F432414 for + <azarah@nosferatu.za.org>; Wed, 17 Dec 2003 20:38:59 +0200 (SAST) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id + S264496AbTLQSSE (ORCPT <rfc822;azarah@nosferatu.za.org>); Wed, 17 Dec 2003 + 13:18:04 -0500 +Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264501AbTLQSSD + (ORCPT <rfc822;linux-kernel-outgoing>); Wed, 17 Dec 2003 13:18:03 -0500 +Received: from e35.co.us.ibm.com ([32.97.110.133]:44511 "EHLO + e35.co.us.ibm.com") by vger.kernel.org with ESMTP id S264496AbTLQSRn + convert rfc822-to-8bit (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, + 17 Dec 2003 13:17:43 -0500 +Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com + [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id + hBHIHfcp501168; Wed, 17 Dec 2003 13:17:41 -0500 +Received: from DYN319713.beaverton.ibm.com (d03av02.boulder.ibm.com + [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with + ESMTP id hBHIHcbA057482; Wed, 17 Dec 2003 11:17:39 -0700 +From: Daniel Stekloff <dsteklof@us.ibm.com> +To: azarah@gentoo.org, Linux Kernel Mailing Lists <linux-kernel@vger.kernel.org> +Subject: Re: scsi_id segfault with udev-009 +Date: Wed, 17 Dec 2003 10:17:28 -0800 +User-Agent: KMail/1.4.1 +Cc: Greg KH <greg@kroah.com> +References: <1071682198.5067.17.camel@nosferatu.lan> +In-Reply-To: <1071682198.5067.17.camel@nosferatu.lan> +Message-Id: <200312171017.28358.dsteklof@us.ibm.com> +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +X-Mailing-List: linux-kernel@vger.kernel.org +X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on + gateway.lan +X-Spam-Level: +X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no + version=2.60 +X-Sanitizer: Advosys mail filter +MIME-Version: 1.0 +Content-Type: text/plain; charset="US-ASCII" +X-Evolution-Source: pop://azarah@gateway.lan +Content-Transfer-Encoding: 8bit + +On Wednesday 17 December 2003 09:29 am, Martin Schlemmer wrote: +> Hi +> +> Getting this with scsi_id and udev-009: + + +Hi, + +Scsi_id hasn't been changed to use the latest libsysfs changes. The +"directory" in the sysfs_class_device is now considered "private" and only +should be accessed using functions. Treating the structures as handles lets +us only load information when it's needed, reducing caching or stale +information and also helping performance. + +Here's the problem. + +static inline char *sysfs_get_attr(struct sysfs_class_device *dev, + const char *attr) +{ + return sysfs_get_value_from_attributes(dev->directory->attributes, + attr); +} + +Please try this quick fix: + +--- udev/extras/scsi_id/scsi_id.h 2003-12-08 01:42:46.000000000 -0800 ++++ udev-fix/extras/scsi_id/scsi_id.h 2003-12-17 09:52:31.032184768 -0800 +@@ -42,8 +42,14 @@ + static inline char *sysfs_get_attr(struct sysfs_class_device *dev, + const char *attr) + { +- return sysfs_get_value_from_attributes(dev->directory->attributes, +- attr); ++ struct dlist *attributes = NULL; ++ ++ attributes = sysfs_get_classdev_attributes(dev); ++ ++ if (attributes == NULL) ++ return NULL; ++ ++ return sysfs_get_value_from_attributes(attributes, attr); + } + + extern int scsi_get_serial (struct sysfs_class_device *scsi_dev, +--- udev/extras/scsi_id/scsi_id.c 2003-12-08 01:42:46.000000000 -0800 ++++ udev-fix/extras/scsi_id/scsi_id.c 2003-12-17 09:55:54.113311744 -0800 +@@ -133,7 +133,7 @@ + return -1; + + snprintf(bus_dev_name, MAX_NAME_LEN, "%s/%s/%s/%s/%s", sysfs_mnt_path, +- SYSFS_BUS_DIR, bus, SYSFS_DEVICES_NAME, bus_id); ++ SYSFS_BUS_NAME, bus, SYSFS_DEVICES_NAME, bus_id); + + if (stat(sysfs_path, &stat_buf)) + return -1; + +- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/ |