[PATCH] Fix block device symlink name
authorStephen Rothwell <sfr@canb.auug.org.au>
Mon, 10 Apr 2006 07:17:20 +0000 (00:17 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 17 Apr 2006 20:16:05 +0000 (13:16 -0700)
As noted further on the this file, some block devices have a / in their
name, so fix the "block:..." symlink name the same as the /sys/block name.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/partitions/check.c

index f924f459bdb8063cebbbeba8111797b6b1214b44..2ef03aa542ff55e33af5b43c480d75a8fa0c0c35 100644 (file)
@@ -345,6 +345,7 @@ static char *make_block_name(struct gendisk *disk)
        char *name;
        static char *block_str = "block:";
        int size;
+       char *s;
 
        size = strlen(block_str) + strlen(disk->disk_name) + 1;
        name = kmalloc(size, GFP_KERNEL);
@@ -352,6 +353,10 @@ static char *make_block_name(struct gendisk *disk)
                return NULL;
        strcpy(name, block_str);
        strcat(name, disk->disk_name);
+       /* ewww... some of these buggers have / in name... */
+       s = strchr(name, '/');
+       if (s)
+               *s = '!';
        return name;
 }