Messages in this thread Patch in this message | | | Date | Wed, 8 Feb 2006 15:39:57 -0800 | From | Chris Wright <> | Subject | [PATCH 24/23] md: remove slashes from disk names when creation dev names in sysfs |
| |
-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 <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org> --- 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/
| |