Commit fe08f9d5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] name_to_dev_t() fix

From: viro@parcelfarce.linux.theplanet.co.uk

When we register disks, we mangle the disk names that contain slashes (e.g.
cciss/c0d0) replacing them with '!' in corresponding sysfs names.  So
name_to_dev_t() should mangle the name in the same way before looking for it
in /sys/block.
parent f2d652b1
...@@ -130,7 +130,7 @@ static dev_t __init try_name(char *name, int part) ...@@ -130,7 +130,7 @@ static dev_t __init try_name(char *name, int part)
* Driverfs is used to check if something is a disk name - it has * Driverfs is used to check if something is a disk name - it has
* all known disks under bus/block/devices. If the disk name * all known disks under bus/block/devices. If the disk name
* contains slashes, name of driverfs node has them replaced with * contains slashes, name of driverfs node has them replaced with
* dots. try_name() does the actual checks, assuming that driverfs * bangs. try_name() does the actual checks, assuming that driverfs
* is mounted on rootfs /sys. * is mounted on rootfs /sys.
*/ */
...@@ -169,7 +169,7 @@ dev_t __init name_to_dev_t(char *name) ...@@ -169,7 +169,7 @@ dev_t __init name_to_dev_t(char *name)
strcpy(s, name); strcpy(s, name);
for (p = s; *p; p++) for (p = s; *p; p++)
if (*p == '/') if (*p == '/')
*p = '.'; *p = '!';
res = try_name(s, 0); res = try_name(s, 0);
if (res) if (res)
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment