[PATCH] Fix block device symlink name

From: Stephen Rothwell
Date: Mon Apr 10 2006 - 01:23:11 EST


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.

(code and comment copied from below)

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---

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

This might also be a candidate for a stable kernel.
--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx

088ec2acec602096210801cfdc0e4732d81de10d
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index f924f45..2ef03aa 100644
--- a/fs/partitions/check.c
+++ b/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;
}

--
1.2.4
-
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/