Skip to contentSkip to conversation

2.5.65 jaz drive devfs oops

DISCUSSION Matthew Harrell 2 participants 8 messages Mar 19, 2003 – Mar 21, 2003 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Once the jaz drive spins down and then I try to access it again it either doesn't respond ever, hangs the process permenantly, or generates the attached oops. If anyone wants more info let me know and I'll reboot back with devfs turned on

Signature · 3 lines
  Matthew Harrell                          Nondeterminism means never
  Bit Twiddlers, Inc.                       having to say you are wrong.
  [email protected]     

sdb: Spinning up disk...........ready
SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
sdb: Write Protect is off
sdb: Mode Sense: 39 00 10 08
SCSI device sdb: drive cache: write back

Unable to handle kernel paging request at virtual address 6c2e736d
 printing eip:
c01ab5b3
*pde = 00000000
Oops: 0002
CPU:    0
EIP:    0060:[<c01ab5b3>]    Not tainted
EFLAGS: 00010202

EIP is at devfs_unregister+0x23/0x50
eax: 6c2e736d ebx: c15f6240 ecx: c15740fc edx: 00000000
esi: 001fe7e0 edi: c15717e0 ebp: 00000001 esp: d1b13d10
ds: 007b es: 007b ss: 0068
Process tcsh (pid: 22836, threadinfo=d1b12000 task=c40eec60)

Stack: 00000000 c017154e c1574150 c0187ce3 c15f6240 00000005 c15717e0 c0188101 
       d7e08740 00000004 0000001e 00000001 fffffffa c15f2c00 fffffffa c0280b9c 
       00000000 00000001 00000000 d7e08740 c15717e0 00000001 c01608ec d7e08740 
Call Trace:
 [<c017154e>] invalidate_device+0x6e/0x90
 [<c0187ce3>] delete_partition+0x83/0xa0
 [<c0188101>] rescan_partitions+0x151/0x160
 [<c0280b9c>] sd_open+0xac/0x120
 [<c01608ec>] do_open+0xfc/0x410
 [<c0160c7e>] blkdev_get+0x7e/0xa0
 [<c0160730>] __check_disk_change+0x40/0x70
 [<c01abc35>] check_disc_changed+0x45/0x50
 [<c01abc6f>] scan_dir_for_removable+0x2f/0x80
 [<c01ac237>] devfs_readdir+0x197/0x220
 [<c016a82e>] vfs_readdir+0x9e/0xa0
 [<c016ab50>] filldir64+0x0/0x120
 [<c016ad0a>] sys_getdents64+0x9a/0xdd
 [<c016ab50>] filldir64+0x0/0x120
 [<c0169b71>] do_fcntl+0xe1/0x1b0
 [<c0158300>] default_llseek+0x0/0xd0
 [<c0158453>] sys_lseek+0x83/0xa0
 [<c010941f>] syscall_call+0x7/0xb

Code: f0 81 28 00 00 00 01 0f 85 2b 23 00 00 89 5c 24 04 8b 43 20 
Quoted 8 lines
Quoted 8 lines

EIP; c01ab5b3 <devfs_unregister+23/50> <=====

eax; 6c2e736d <__crc_ide_do_reset+63b51/399654> ebx; c15f6240 <__crc_global_cache_flush+72dda/2b10e2> ecx; c15740fc <__crc_memcpy_tokerneliovec+316074/3253de> esi; 001fe7e0 <__crc_smp_call_function+b280f/3c30bf> edi; c15717e0 <__crc_memcpy_tokerneliovec+313758/3253de> esp; d1b13d10 <__crc_pci_scan_slot+1d8152/25ce78>

Trace; c017154e <invalidate_device+6e/90>
Trace; c0187ce3 <delete_partition+83/a0>
Trace; c0188101 <rescan_partitions+151/160>
Trace; c0280b9c <sd_open+ac/120>
Trace; c01608ec <do_open+fc/410>
Trace; c0160c7e <blkdev_get+7e/a0>
Trace; c0160730 <__check_disk_change+40/70>
Trace; c01abc35 <check_disc_changed+45/50>
Trace; c01abc6f <scan_dir_for_removable+2f/80>
Trace; c01ac237 <devfs_readdir+197/220>
Trace; c016a82e <vfs_readdir+9e/a0>
Trace; c016ab50 <filldir64+0/120>
Trace; c016ad0a <sys_getdents64+9a/dd>
Trace; c016ab50 <filldir64+0/120>
Trace; c0169b71 <do_fcntl+e1/1b0>
Trace; c0158300 <default_llseek+0/d0>
Trace; c0158453 <sys_lseek+83/a0>
Trace; c010941f <syscall_call+7/b>

Code; c01ab5b3 <devfs_unregister+23/50>
00000000 <_EIP>:
Code; c01ab5b3 <devfs_unregister+23/50> <=====
0: f0 81 28 00 00 00 01 lock subl $0x1000000,(%eax) <=====
Code; c01ab5ba <devfs_unregister+2a/50>
7: 0f 85 2b 23 00 00 jne 2338 <_EIP+0x2338>
Code; c01ab5c0 <devfs_unregister+30/50>
d: 89 5c 24 04 mov %ebx,0x4(%esp,1)
Code; c01ab5c4 <devfs_unregister+34/50>
11: 8b 43 20 mov 0x20(%ebx),%eax

#1 lore raw
Quoted 5 lines · Matthew Harrell

Once the jaz drive spins down and then I try to access it again it either doesn't respond ever, hangs the process permenantly, or generates the attached oops. If anyone wants more info let me know and I'll reboot back with devfs turned on

This looks like the devfs (mis-)feature to reread partition tables at inappropinquate places is biting us again.

Could you try the following patch (posted to lkml two times already)?

arch/um/drivers/ubd_kern.c +1 -1
@@ -507,7 +507,7 @@
 	/* /dev/ubd/N style names */
 	sprintf(devfs_name, "%d", unit);
 	*handle_out = devfs_register(dir_handle, devfs_name,
-				     DEVFS_FL_REMOVABLE, major, minor,
+				     0, major, minor,
 				     S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |
 				     S_IWGRP, &ubd_blops, NULL);
 	disk->private_data = &ubd_dev[unit];
fs/devfs/base.c +10 -125

242 lines not on this page · raw message

===== fs/partitions/check.c 1.96 vs edited =====

fs/partitions/check.c +2 -8
@@ -156,7 +156,6 @@
 {
 #ifdef CONFIG_DEVFS_FS
 	devfs_handle_t dir;
-	unsigned int devfs_flags = DEVFS_FL_DEFAULT;
 	struct hd_struct *p = dev->part;
 	char devname[16];
 
@@ -165,10 +164,8 @@
 	dir = dev->de;
 	if (!dir)
 		return;
-	if (dev->flags & GENHD_FL_REMOVABLE)
-		devfs_flags |= DEVFS_FL_REMOVABLE;
 	sprintf(devname, "part%d", part);
-	p[part-1].de = devfs_register (dir, devname, devfs_flags,
+	p[part-1].de = devfs_register (dir, devname, 0,
 				    dev->major, dev->first_minor + part,
 				    S_IFBLK | S_IRUSR | S_IWUSR,
 				    dev->fops, NULL);
@@ -185,11 +182,8 @@
 #ifdef CONFIG_DEVFS_FS
 	int pos = 0;
 	devfs_handle_t dir, slave;
-	unsigned int devfs_flags = DEVFS_FL_DEFAULT;
 	char dirname[64], symlink[16];
 
-	if (dev->flags & GENHD_FL_REMOVABLE)
-		devfs_flags |= DEVFS_FL_REMOVABLE;
 	if (dev->flags & GENHD_FL_DEVFS) {
 		dir = dev->de;
 		if (!dir)  /*  Aware driver wants to block disc management  */
@@ -209,7 +203,7 @@
 	sprintf(symlink, "discs/disc%d", dev->number);
 	devfs_mk_symlink(NULL, symlink, DEVFS_FL_DEFAULT,
 			  dirname + pos, &slave, NULL);
-	dev->disk_de = devfs_register(dir, "disc", devfs_flags,
+	dev->disk_de = devfs_register(dir, "disc", 0,
 			    dev->major, dev->first_minor,
 			    S_IFBLK | S_IRUSR | S_IWUSR, dev->fops, NULL);
 #endif
include/linux/devfs_fs_kernel.h +0 -1
@@ -13,7 +13,6 @@
 
 #define DEVFS_FL_NONE           0x000 /* This helps to make code more readable
 				       */
-#define DEVFS_FL_REMOVABLE      0x008 /* This is a removable media device    */
 #define DEVFS_FL_WAIT           0x010 /* Wait for devfsd to finish           */
 #define DEVFS_FL_CURRENT_OWNER  0x020 /* Set initial ownership to current    */
 #define DEVFS_FL_DEFAULT        DEVFS_FL_NONE
#2 lore raw

: > Once the jaz drive spins down and then I try to access it again it either : > doesn't respond ever, hangs the process permenantly, or generates the : > attached oops. If anyone wants more info let me know and I'll reboot back : > with devfs turned on
:
: This looks like the devfs (mis-)feature to reread partition tables at : inappropinquate places is biting us again.
:
:
: Could you try the following patch (posted to lkml two times already)?

So far it's looking good. I waited until the drive had totally spun down then tried going to it's automount directory and it spun up and mounted fine

sdb: Spinning up disk...........ready
SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
sdb: Write Protect is off
sdb: Mode Sense: 39 00 10 08
SCSI device sdb: drive cache: write back
SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
sdb: Write Protect is off
sdb: Mode Sense: 39 00 10 08
SCSI device sdb: drive cache: write back
/dev/scsi/host0/bus0/target4/lun0: p4
found reiserfs format "3.6" with standard journal
Reiserfs journal params: device sd(8,20), size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
reiserfs: checking transaction log (sd(8,20)) for (sd(8,20))
Using r5 hash to sort names

I'll try it again in an hour or so with some different tests. Thanks for the patch

Signature · 3 lines
  Matthew Harrell                          If at first you don't succeed,
  Bit Twiddlers, Inc.                       try management.
  [email protected]     
#3 lore raw

Well, the second test just now didn't work right. /dev/scsi/host0/bus0/target4/lun0/disc did exist this time around but I got the same error as before trying to get anything going on it and I can no longer get the jaz drive to work.

: So far it's looking good. I waited until the drive had totally spun down : then tried going to it's automount directory and it spun up and mounted fine :

:   sdb: Spinning up disk...........ready
:   SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
:   sdb: Write Protect is off
:   sdb: Mode Sense: 39 00 10 08
:   SCSI device sdb: drive cache: write back
:   SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
:   sdb: Write Protect is off
:   sdb: Mode Sense: 39 00 10 08
:   SCSI device sdb: drive cache: write back
:    /dev/scsi/host0/bus0/target4/lun0: p4
:   found reiserfs format "3.6" with standard journal
:   Reiserfs journal params: device sd(8,20), size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
:   reiserfs: checking transaction log (sd(8,20)) for (sd(8,20))
:   Using r5 hash to sort names

:
: I'll try it again in an hour or so with some different tests. Thanks for the : patch

Signature · 3 lines
  Matthew Harrell                          If you can't convince them, 
  Bit Twiddlers, Inc.                       confuse them...
  [email protected]     
#4 lore raw

And, even with "devfs=nomount" on the boot line and no devfs used I still get the same error once the jaz drive totally cycles down.

Besides building the kernel without devfs is there a good solution for this?

: Well, the second test just now didn't work right.
: /dev/scsi/host0/bus0/target4/lun0/disc did exist this time around but I got : the same error as before trying to get anything going on it and I can no : longer get the jaz drive to work.

Signature · 3 lines
  Matthew Harrell                          Dogs have masters,
  Bit Twiddlers, Inc.                       cats have staff
  [email protected]
#5 lore raw
Quoted 3 lines · Matthew Harrell

And, even with "devfs=nomount" on the boot line and no devfs used I still get the same error once the jaz drive totally cycles down.

Is the OOPS with devfs=nomount exactly the same? If no or you're unsure please post it, too.

Quoted 1 line

Besides building the kernel without devfs is there a good solution for this?

Well, not compiling in devfs is always a good idea :) But we should fix this anyway.

#6 lore raw

: > And, even with "devfs=nomount" on the boot line and no devfs used I still : > get the same error once the jaz drive totally cycles down.
:
: Is the OOPS with devfs=nomount exactly the same? If no or you're : unsure please post it, too.

Yep, it's always mounted the same but the other thing I just remembered is that it's set up to use the automounter every time I go into /mnt/jaz. So, if I permenantly mount the jaz drive somewhere and just have /mnt/jaz be a intra-system link then it does work. I guess this means it's a problem with the jaz drive spinning down and "detaching" itself from the scsi bus?

I decided I would try it that way for the moment since I could then keep devfs on the system. No oops but I'm sure if I unmounted it for about an hour and then tried to mount it again it would oops

Signature · 3 lines
  Matthew Harrell                          Every morning is the dawn of a
  Bit Twiddlers, Inc.                       new error.
  [email protected]     
#7 lore raw
In reply to Christoph Hellwig

: Is the OOPS with devfs=nomount exactly the same? If no or you're : unsure please post it, too.

I misread this the first time. It looks different but I'm not sure I got good output from ksymoops. I attached the raw oops and the procesed oops below. This is with kernel 2.5.65-bk1 SMP with that devfs patch

Signature · 3 lines
  Matthew Harrell                          Do not meddle in the affairs of cats
  Bit Twiddlers, Inc.                       for they are subtle and will piss
  [email protected]                 on your computer
Unable to handle kernel paging request at virtual address 6f6c2e6d
c01ab313
*pde = 00000000
Oops: 0002 [#1]
CPU:    1
EIP:    0060:[devfs_unregister+35/80]    Not tainted
EFLAGS: 00010202
eax: 6f6c2e6d   ebx: c15f6240   ecx: c15740fc   edx: 00000000
esi: 001fe7e0   edi: c1571720   ebp: 00000001   esp: c1b19b58
ds: 007b   es: 007b   ss: 0068
Stack: 00000000 c017136e c1574150 c0187ad3 c15f6240 00000005 c1571720 c0187ef1 
       d7e08740 00000004 0000001e 00000001 fffffffa c15f2c00 fffffffa c028070c 
       00000000 00000001 00000000 d7e08740 c1571720 00000001 c016070c d7e08740 
Call Trace:

Warning (Oops_read): Code line not seen, dumping what data is available

Quoted 6 lines
Quoted 6 lines

eax; 6f6c2e6d <__crc_xfrm_policy_insert+1d29de/ac2af0> ebx; c15f6240 <__crc_global_cache_flush+72dda/1b3b85> ecx; c15740fc <__crc_memcpy_tokerneliovec+316074/3253de> esi; 001fe7e0 <__crc_smp_call_function+b280f/25f714> edi; c1571720 <__crc_memcpy_tokerneliovec+313698/3253de> esp; c1b19b58 <__crc_unregister_chrdev+1ec6c7/2f9bc8>

Code: f0 81 28 00 00 00 01 0f 85 fb 20 00 00 89 5c 24 04 8b 43 20 

Using defaults from ksymoops -t elf32-i386 -a i386

Code; 00000000 Before first symbol
00000000 <_EIP>:
Code; 00000000 Before first symbol
0: f0 81 28 00 00 00 01 lock subl $0x1000000,(%eax)
Code; 00000007 Before first symbol
7: 0f 85 fb 20 00 00 jne 2108 <_EIP+0x2108>
Code; 0000000d Before first symbol
d: 89 5c 24 04 mov %ebx,0x4(%esp,1)
Code; 00000011 Before first symbol
11: 8b 43 20 mov 0x20(%ebx),%eax

sdb: Spinning up disk...........ready
SCSI device sdb: 2091050 512-byte hdwr sectors (1071 MB)
sdb: Write Protect is off
sdb: Mode Sense: 39 00 10 08
SCSI device sdb: drive cache: write back

Unable to handle kernel paging request at virtual address 6f6c2e6d
 printing eip:
c01ab313
*pde = 00000000
Oops: 0002 [#1]
CPU:    1
EIP:    0060:[devfs_unregister+35/80]    Not tainted
EFLAGS: 00010202

EIP is at devfs_unregister+0x23/0x50
eax: 6f6c2e6d ebx: c15f6240 ecx: c15740fc edx: 00000000
esi: 001fe7e0 edi: c1571720 ebp: 00000001 esp: c1b19b58
ds: 007b es: 007b ss: 0068
Process mount (pid: 13732, threadinfo=c1b18000 task=d2efd960)

Stack: 00000000 c017136e c1574150 c0187ad3 c15f6240 00000005 c1571720 c0187ef1 
       d7e08740 00000004 0000001e 00000001 fffffffa c15f2c00 fffffffa c028070c 
       00000000 00000001 00000000 d7e08740 c1571720 00000001 c016070c d7e08740 
Call Trace:
 [invalidate_device+110/144] invalidate_device+0x6e/0x90
 [delete_partition+131/160] delete_partition+0x83/0xa0
 [rescan_partitions+337/352] rescan_partitions+0x151/0x160
 [sd_open+172/288] sd_open+0xac/0x120
 [do_open+252/1040] do_open+0xfc/0x410
 [do_page_fault+316/1151] do_page_fault+0x13c/0x47f
 [blkdev_get+126/160] blkdev_get+0x7e/0xa0
 [do_open+619/1040] do_open+0x26b/0x410
 [blkdev_get+126/160] blkdev_get+0x7e/0xa0
 [open_bdev_excl+103/176] open_bdev_excl+0x67/0xb0
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [get_sb_bdev+55/352] get_sb_bdev+0x37/0x160
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [__crc_device_add+1467694/1798932] get_super_block+0x2f/0x33 [reiserfs]
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [__crc_device_add+1466095/1798932] reiserfs_fill_super+0x0/0x5c0 [reiserfs]
 [do_kern_mount+99/272] do_kern_mount+0x63/0x110
 [__crc_device_add+1598495/1798932] reiserfs_fs_type+0x0/0x6c [reiserfs]
 [do_add_mount+129/368] do_add_mount+0x81/0x170
 [do_mount+385/464] do_mount+0x181/0x1d0
 [copy_mount_options+218/224] copy_mount_options+0xda/0xe0
 [sys_mount+225/320] sys_mount+0xe1/0x140
 [syscall_call+7/11] syscall_call+0x7/0xb

Code: f0 81 28 00 00 00 01 0f 85 fb 20 00 00 89 5c 24 04 8b 43 20