Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030615AbWBHXds (ORCPT ); Wed, 8 Feb 2006 18:33:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030618AbWBHXds (ORCPT ); Wed, 8 Feb 2006 18:33:48 -0500 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:14979 "EHLO sorel.sous-sol.org") by vger.kernel.org with ESMTP id S1030615AbWBHXds (ORCPT ); Wed, 8 Feb 2006 18:33:48 -0500 Date: Wed, 8 Feb 2006 15:39:57 -0800 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: "Theodore Ts'o" , Zwane Mwaikambo , Justin Forbes , torvalds@osdl.org, Randy Dunlap , Dave Jones , Chuck Wolber , alan@lxorguk.ukuu.org.uk Subject: [PATCH 24/23] md: remove slashes from disk names when creation dev names in sysfs Message-ID: <20060208233957.GP30803@sorel.sous-sol.org> References: <20060208064503.924238000@sorel.sous-sol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060208064503.924238000@sorel.sous-sol.org> User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1462 Lines: 45 -stable review patch. If anyone has any objections, please let us know. (this should've been in the series. i missed this one, mea culpa) ------------------ e.g. The sx8 driver uses names like sx8/0. This would make a md component dev name like /sys/block/md0/md/dev-sx8/0 which is not allowed. So we change the '/' to '!' just like fs/partitions/check.c(register_disk) does. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright --- drivers/md/md.c | 3 +++ 1 files changed, 3 insertions(+) --- linux-2.6.15.3.orig/drivers/md/md.c +++ linux-2.6.15.3/drivers/md/md.c @@ -1182,6 +1182,7 @@ static int bind_rdev_to_array(mdk_rdev_t mdk_rdev_t *same_pdev; char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; struct kobject *ko; + char *s; if (rdev->mddev) { MD_BUG(); @@ -1213,6 +1214,8 @@ static int bind_rdev_to_array(mdk_rdev_t bdevname(rdev->bdev,b); if (kobject_set_name(&rdev->kobj, "dev-%s", b) < 0) return -ENOMEM; + while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL) + *s = '!'; list_add(&rdev->same_set, &mddev->disks); rdev->mddev = mddev; - 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/