summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-04-10 00:17:20 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-17 13:16:05 -0700
commit49e91c3b2131b16ea13e3b44426c5a577e9b4fd8 (patch)
tree3c07739b00b6ce470057627337162e70b304b81b
parent2b53303840e1a8f1c7d007d988e8f497248ca270 (diff)
downloadkernel-common-49e91c3b2131b16ea13e3b44426c5a577e9b4fd8.tar.gz
kernel-common-49e91c3b2131b16ea13e3b44426c5a577e9b4fd8.tar.bz2
kernel-common-49e91c3b2131b16ea13e3b44426c5a577e9b4fd8.zip
[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 <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>
-rw-r--r--fs/partitions/check.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index f924f459bdb8..2ef03aa542ff 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;
}