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

[PATCH] dm: decimal device num sscanf

From: Joe Thornber <thornber@sistina.com>

The 2.4 version of Device-Mapper scans for device-numbers in decimal
instead of hex (in dm_get_device()). Update 2.6 so both versions use
the same behavior.  [Kevin Corry]
parent 7e22b406
...@@ -418,12 +418,12 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti, ...@@ -418,12 +418,12 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
int r; int r;
dev_t dev; dev_t dev;
struct dm_dev *dd; struct dm_dev *dd;
int major, minor; unsigned int major, minor;
if (!t) if (!t)
BUG(); BUG();
if (sscanf(path, "%x:%x", &major, &minor) == 2) { if (sscanf(path, "%u:%u", &major, &minor) == 2) {
/* Extract the major/minor numbers */ /* Extract the major/minor numbers */
dev = MKDEV(major, minor); dev = MKDEV(major, minor);
} else { } else {
......
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