Hi,
I see a problem with recent 2.5 kernels and SCSI st and devfs.
As you can see from the output down under the minors are off by 4.
I rechecked that 9,128 (as described in Documentation/devices.txt)
would be correct for nst0 by calling mknod and *tata* the backup
would be running fine again (at least mt is working again - not
running a backup...).
So minors should be the number of the tape device and not
the number of the target counting from 0.
This is what it used to be:
bz@megablast:/dev/scsi/host0/bus0/target5/lun0> ls -l
total 0
crw-r----- 1 root root 21, 3 Jan 1 1970 generic
crw-rw-rw- 1 root root 9, 0 Jan 1 1970 mt
crw-rw-rw- 1 root root 9, 96 Jan 1 1970 mta
crw-rw-rw- 1 root root 9, 224 Jan 1 1970 mtan
crw-rw-rw- 1 root root 9, 32 Jan 1 1970 mtl
crw-rw-rw- 1 root root 9, 160 Jan 1 1970 mtln
crw-rw-rw- 1 root root 9, 64 Jan 1 1970 mtm
crw-rw-rw- 1 root root 9, 192 Jan 1 1970 mtmn
crw-rw-rw- 1 root root 9, 128 Jan 1 1970 mtn
bz@megablast:/> uname -a
Linux megablast 2.5.38 #57 SMP Wed Sep 25 17:38:37 UTC 2002 i686 unknown
[this was bk checkout from 20020923-211332 UTC]
this is what I get with latest 2.5.40-bk:
/dev/{nst0 resp nst4}: No such device or address
bz@megablast:/dev/scsi/host0/bus0/target5/lun0> ls -l
total 0
crw-r----- 1 root root 21, 3 Jan 1 1970 generic
crw-rw-rw- 1 root root 9, 4 Jan 1 1970 mt
crw-rw-rw- 1 root root 9, 100 Jan 1 1970 mta
crw-rw-rw- 1 root root 9, 228 Jan 1 1970 mtan
crw-rw-rw- 1 root root 9, 36 Jan 1 1970 mtl
crw-rw-rw- 1 root root 9, 164 Jan 1 1970 mtln
crw-rw-rw- 1 root root 9, 68 Jan 1 1970 mtm
crw-rw-rw- 1 root root 9, 196 Jan 1 1970 mtmn
crw-rw-rw- 1 root root 9, 132 Jan 1 1970 mtn
bz@megablast:/dev/scsi/host0/bus0/target5/lun0> uname -a
Linux megablast 2.5.40 #77 SMP Sat Oct 5 07:43:57 UTC 2002 i686 unknown
[bk-2.5 checkout, 20021005-060333 UTC]
--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/
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
On Sat, 5 Oct 2002, Kai Makisara wrote:
> 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.
Thought of s.th. like this but had no old version a hand ..
I'll give it a look and if it seems ok, I'll give it a try and let you know ...
--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/
On Sat, 5 Oct 2002, Bjoern A. Zeeb wrote:
Hi,
> On Sat, 5 Oct 2002, Kai Makisara wrote:
>
> > 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.
>
> Thought of s.th. like this but had no old version a hand ..
> I'll give it a look and if it seems ok, I'll give it a try and let you know ...
attached patch makes it work fine again and does no longer use the i which
is counted up to ST_NBR_PARTITIONS = 4, always resulting in a minor = ( n + ) 4
as you said.
bz@megablast:/dev/scsi/host0/bus0/target5/lun0> ls -l
total 0
crw-r----- 1 root root 21, 3 Jan 1 1970 generic
crw-rw-rw- 1 root root 9, 0 Jan 1 1970 mt
crw-rw-rw- 1 root root 9, 96 Jan 1 1970 mta
crw-rw-rw- 1 root root 9, 224 Jan 1 1970 mtan
crw-rw-rw- 1 root root 9, 32 Jan 1 1970 mtl
crw-rw-rw- 1 root root 9, 160 Jan 1 1970 mtln
crw-rw-rw- 1 root root 9, 64 Jan 1 1970 mtm
crw-rw-rw- 1 root root 9, 192 Jan 1 1970 mtmn
crw-rw-rw- 1 root root 9, 128 Jan 1 1970 mtn
You may also fetch the file from
http://sources.zabbadoz.net/linux_kernel/linux-2.5.40-20021005-060333-scsi-st-minor.bkcset
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
[email protected], 2002-10-05 14:36:56+00:00, [email protected]
st.c:
SCSI: fixed minor numbers in st.c for devfs & driverfs
st.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff -Nru a/drivers/scsi/st.c b/drivers/scsi/st.c
--- a/drivers/scsi/st.c Sat Oct 5 14:47:35 2002
+++ b/drivers/scsi/st.c Sat Oct 5 14:47:35 2002
@@ -3832,14 +3832,14 @@
tpnt->driverfs_dev_r[mode].parent = &SDp->sdev_driverfs_dev;
tpnt->driverfs_dev_r[mode].bus = &scsi_driverfs_bus_type;
tpnt->driverfs_dev_r[mode].driver_data =
- (void *)(long)__mkdev(MAJOR_NR, i + (mode << 5));
+ (void *)(long)__mkdev(MAJOR_NR, dev_num + (mode << 5));
device_register(&tpnt->driverfs_dev_r[mode]);
device_create_file(&tpnt->driverfs_dev_r[mode],
&dev_attr_type);
device_create_file(&tpnt->driverfs_dev_r[mode], &dev_attr_kdev);
tpnt->de_r[mode] =
devfs_register (SDp->de, name, DEVFS_FL_DEFAULT,
- MAJOR_NR, i + (mode << 5),
+ MAJOR_NR, dev_num + (mode << 5),
S_IFCHR | S_IRUGO | S_IWUGO,
&st_fops, NULL);
/* No-rewind entry */
@@ -3851,7 +3851,7 @@
tpnt->driverfs_dev_n[mode].parent= &SDp->sdev_driverfs_dev;
tpnt->driverfs_dev_n[mode].bus = &scsi_driverfs_bus_type;
tpnt->driverfs_dev_n[mode].driver_data =
- (void *)(long)__mkdev(MAJOR_NR, i + (mode << 5) + 128);
+ (void *)(long)__mkdev(MAJOR_NR, dev_num + (mode << 5) + 128);
device_register(&tpnt->driverfs_dev_n[mode]);
device_create_file(&tpnt->driverfs_dev_n[mode],
&dev_attr_type);
@@ -3859,7 +3859,7 @@
&dev_attr_kdev);
tpnt->de_n[mode] =
devfs_register (SDp->de, name, DEVFS_FL_DEFAULT,
- MAJOR_NR, i + (mode << 5) + 128,
+ MAJOR_NR, dev_num + (mode << 5) + 128,
S_IFCHR | S_IRUGO | S_IWUGO,
&st_fops, NULL);
}
===================================================================
This BitKeeper patch contains the following changesets:
1.716
## Wrapped with gzip_uu ##
begin 664 bkpatch10150
M'XL(`(?[GCT``[54[V_:,!#]'/\5)U6:8$!B.['S8V6BH]/6=5T1J)^1DS@E
M@B13'&B'\L?/D`K0*L:&MB32Q:>[YW?/3[Z`!R7+P`C7Z`(^%ZH*C+4(0Q$7
M:S.7E4Z.BT(GK:4J+55&5CCO+=)\^;S[Z5&3(5TW$E4T@Y4L56`0T]YEJA_?
M96",/WYZ^'HU1JC?A^%,Y(]R(BOH]U%5E"NQB-5`5+-%D9M5*7*5R4J849'5
MN]*:8DSURXAK8\9KPK'CUA&)"1$.D3&FCL>=/=JLR.1OL0C&#%/J8;^FE/L4
M70,Q7<(!4XM@"S,@3F#S@/$.Q@'&$*X'A\I`AT`/HP_P;P<8H@A494:!C@"3
MX>0F@"1]EC%D:5Z4D"^S4$L,:;XM@T3G8KE*%+R!N$RU_(E"MT")QUTTVDN-
M>G_Y((0%1N]/C-=LJ2P5J=3:$#H8T\'8K3FC#J\3+&(/2S=A293X0OPJYA&<
MS1D1F_G4KQGEF&W=\ZKTM(O.9(EN16K>B7FJ1"D&\V*AM5\J,TF/`6JBU";,
MMFNFEVQK*>H?.,H.F!]0_YBC'.@Y_\519_NHD?T>>N73]M.^&+T^@3/,=6U[
MMA8$W;Q$PS!:JR*-X6V[I6=^;$^GV5P3:MU=?;D?3[^-NQMZ4TT;.M#*BEC"
MY26P=OO=!LJA#=0V:BCC1%=WT\2<IFD;S]U?KPCU&A;\A07_0Q9-;W=_>48S
5&<W5,NO';NAZA,?H)ROJOBZ?!0``
`
end
--
Greetings
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/