From: Stephen Rothwell Date: Mon, 10 Apr 2006 07:17:20 +0000 (-0700) Subject: [PATCH] Fix block device symlink name X-Git-Tag: v2.6.16.6~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49e91c3b2131b16ea13e3b44426c5a577e9b4fd8;p=thirdparty%2Fkernel%2Fstable.git [PATCH] Fix block device symlink name 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 Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/partitions/check.c b/fs/partitions/check.c index f924f459bdb80..2ef03aa542ff5 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -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; }