[patch 11/22] Fix block device symlink name

From: Greg KH
Date: Thu Apr 13 2006 - 19:16:43 EST


-stable review patch. If anyone has any objections, please let us know.

------------------

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>


---
fs/partitions/check.c | 5 +++++
1 file changed, 5 insertions(+)

--- linux-2.6.16.5.orig/fs/partitions/check.c
+++ linux-2.6.16.5/fs/partitions/check.c
@@ -345,6 +345,7 @@ static char *make_block_name(struct gend
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 gend
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;
}


--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/