* [PATCH] Fix block device symlink name
@ 2006-04-10 5:16 Stephen Rothwell
2006-04-11 11:38 ` Jan Engelhardt
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2006-04-10 5:16 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: LKML
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@canb.auug.org.au>
---
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@canb.auug.org.au
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix block device symlink name
2006-04-10 5:16 [PATCH] Fix block device symlink name Stephen Rothwell
@ 2006-04-11 11:38 ` Jan Engelhardt
2006-04-11 12:08 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Jan Engelhardt @ 2006-04-11 11:38 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Greg Kroah-Hartman, LKML
>@@ -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;
> }
>
Can they have multiple '/'? If so, we need a while loop.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix block device symlink name
2006-04-11 11:38 ` Jan Engelhardt
@ 2006-04-11 12:08 ` Stephen Rothwell
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2006-04-11 12:08 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Greg Kroah-Hartman, LKML
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
On Tue, 11 Apr 2006 13:38:09 +0200 (MEST) Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> >@@ -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;
> > }
> >
>
> Can they have multiple '/'? If so, we need a while loop.
The other place that fixes this (just 10 or so lines further on in this
file) does not loop. Looking through the block devices, there is no
obvious place that creates a name with more than one '/'.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-11 12:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10 5:16 [PATCH] Fix block device symlink name Stephen Rothwell
2006-04-11 11:38 ` Jan Engelhardt
2006-04-11 12:08 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox