Re: SCSI st tape wrong minor in 2.5.40 with devfs

From: Kai Makisara (Kai.Makisara@kolumbus.fi)
Date: Sat Oct 05 2002 - 07:38:29 EST


On Sat, 5 Oct 2002, Bjoern A. Zeeb wrote:

> Hi,
>
> I see a problem with recent 2.5 kernels and SCSI st and devfs.
>
You probably can see it also with driverfs :-(

> As you can see from the output down under the minors are off by 4.
>
The device registration was moved outside the st_dev_arr_lock spinlock but
it seems that I was a bit careless, after all. The driverfs/devicefs
registration loop contains the following lines:

            tpnt->driverfs_dev_r[mode].driver_data =
                        (void *)(long)__mkdev(MAJOR_NR, i + (mode << 5));

            tpnt->de_r[mode] =
                devfs_register (SDp->de, name, DEVFS_FL_DEFAULT,
                                MAJOR_NR, i + (mode << 5),
                                S_IFCHR | S_IRUGO | S_IWUGO,

(two of each type)

In the original location i did contain the device number but here it
contains 4 (from the latest loop). The fix seems to be to replace i by
dev_num but I have not yet tested it.

Thanks for reporting the bug.

--
Kai

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



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:49 EST