lkml.org 
[lkml]   [2006]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    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/
    \
     
     \ /
      Last update: 2006-02-09 00:36    [W:4.179 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site