A bug in MD under Linux 2.2.x

Farshidoo (farshidoo@yahoo.com)
Tue, 20 Jul 1999 03:11:03 -0400 (EDT)


Hi,

I see a bug in MD under Linux 2.2.x. It is about using a device
more than once in many MDs simultaneously. In md.c, for each device,
that is added to a md-device, an inode is allocated to prevent it
from being used in mount and also more than once in any md-devices.

In Linux 2.0.X, it works well because the fs_may_mount() tries to
find the inode of the device and doesn't care if the inode structure
has any i_sb field set or not. But in Linux 2.2.x, this function is
changed and it DOES care about the inode->i_sb field. Because this
field is NULL in inodes of the devices added to md-device, the
fs_may_mount() returns non-zero and it means that the device can be
used.

For regenerating the bug, follow this scenario:

mdadd /dev/md0 /dev/hdc1 (or any other partition)
mdadd /dev/md1 /dev/hdc1
mdrun -pl /dev/md0
mdrun -pl /dev/md1

You'll see that in Linux 2.0.x, the second mdadd command will fail,
but in Linux 2.2.x, it won't and also the second mdrun command will
succeed too!

Because I don't know how this bug fix should be done and also if
I do it, I don't know how my changes will be included in formal
Linux releases, could you follow this bug?

Regards,
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/