Skip to contentSkip to conversation

2.5.70-mm7

DISCUSSION Shane Shrybman 4 participants 4 messages Jun 10, 2003 – Jun 12, 2003

lore
Share & tools
lore
#0 lore raw

Am Die, 2003-06-10 um 22.00 schrieb Konstantin Kletschke:

Quoted 1 line

Well, is the device-mapper module dm-mod not komptaibel anymore with

my

Quoted 2 lines

device-mapper 0.96.08 ?
I did not get it to mount the LVM LVGs and device-mapper was very

angry!

Quoted 1 line

But I am not able to get the error message ATM, something with

"function

Quoted 1 line

not supportet, 2 " or so...

I got the same here. Backed out the device-mapper patches Joe Thornber
posted here, and now it works.

It looks like a problem with the cleanups, at least I didn't see any
ioctl interface change?

Yeah, I got the same. The message is something like "ioctl cmd 2 No such address or device".

Joe, do we need to upgrade some tools or something here?

Regards,

Shane

#1 lore raw

Am Mit, 2003-06-11 um 01.12 schrieb Shane Shrybman:

Quoted 2 lines

Yeah, I got the same. The message is something like "ioctl cmd 2 No such address or device".

Ok, I think I found the problem.

In dm-ioctl.c in the function create this got changed:

- int minor;
+ unsigned int minor = 0;

...

- minor = (param->flags & DM_PERSISTENT_DEV_FLAG) ?
- minor(to_kdev_t(param->dev)) : -1;
+ if (param->flags & DM_PERSISTENT_DEV_FLAG)
+ minor = minor(to_kdev_t(param->dev));

So, the variable minor is 0 now instead of -1 when the device shouldn't be persistent. That's bad because 0 is a valid minor.

And now, in dm.c in alloc_dev, called by dm_create

        /* get a minor number for the dev */
-       minor = (minor < 0) ? next_free_minor() : specific_minor(minor);
-       if (minor < 0) {
+       r = (minor < 0) ? next_free_minor(&minor) :

specific_minor(minor);
+ if (r < 0) {

Here the minor is tested for being < 0 (which by the way can't be with minor being unsigned, so this cleanup is bogus). The kernel always tries to bind the new logical volume devices to the same minor, which of course fails after the first one.

Quoted 1 line

Joe, do we need to upgrade some tools or something here?

No, because there are no new tools and the ioctl interface hasn't changed (same dm-ioctl.h)

Signature · 1 line
Christophe Saout <[email protected]>
#2 lore raw

Christophe,

Quoted 1 line · Christophe Saout

Ok, I think I found the problem.

You are quite right. I am an idiot. I think the simplest way to fix this is stop trying to overload the 'minor' argument to dm_create, and instead have a seperate dm_create_with_minor function call.

ie.

int dm_create(struct dm_table *table, struct mapped_device **md); int dm_create_with_minor(unsigned int minor, struct dm_table *table,

			 struct mapped_device **md);

I'm testing a patch for this now (with LVM this time, not just dmsetup), and will post to the list in the next hour.

Sorry for the inconvenience,

- Joe

#3 lore raw
In reply to Christophe Saout

* Christophe Saout <[email protected]> [Wed, Jun 11, 2003 at

Quoted 7 lines · * 01:33:53AM +0200]:

Ok, I think I found the problem.

In dm-ioctl.c in the function create this got changed:

(quoted diff) +1 -1
-       int minor;                                                                                                                              
+       unsigned int minor = 0;                                                                                                                 

...

Quoted 4 lines

+ r = (minor < 0) ? next_free_minor(&minor) :
specific_minor(minor);
+ if (r < 0) {

If I am seeing this right this changes were introduced in -mm8 (i.e. I wanted to change the code and I saw the changes have already been done).

In spite of that, when I boot -mm8 the device-mapper is very angry :)

device-mapper ioctl cmd 2 failed:
No such device or address
Couldn't load device

        'GinaWild-l_swp0'.                                                                                                                        

This is hopefully written down from screen correct so that the error should be clear...

Konsti

PS.:
Sorry Christophe, first attempt went out directly to your e-mail adress, sometimes mutt drives me mad :-/

Signature · 5 lines
2.5.70-mm4
Konstantin Kletschke <[email protected]>, <[email protected]>
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E  A080 1E69 3FDA EF62 FCEF
keulator.homelinux.org up 24 min, 1