2.5.65 jaz drive devfs oops

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Thu, 20 Mar 2003 21:20:14



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

--
  Matthew Harrell                          Nondeterminism means never
  Bit Twiddlers, Inc.                       having to say you are wrong.

  oops.txt
1K Download

  oops-trace.txt
1K Download
 
 
 

2.5.65 jaz drive devfs oops

Post by Christoph Hellwi » Thu, 20 Mar 2003 21:40:08


On Wed, Mar 19, 2003 at 02:14:50PM -0500, Matthew Harrell wrote:

> 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)?

--- 1.27/arch/um/drivers/ubd_kern.c     Sat Mar  8 17:50:21 2003
+++ edited/arch/um/drivers/ubd_kern.c   Wed Mar 12 10:35:30 2003
@@ -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];
--- 1.73/fs/devfs/base.c        Tue Mar 11 09:42:24 2003
+++ edited/fs/devfs/base.c      Wed Mar 12 11:10:01 2003
@@ -758,7 +758,6 @@
     rwlock_t lock;                   /*  Lock for searching(R)/updating(W)   */
     struct devfs_entry *first;
     struct devfs_entry *last;
-    unsigned short num_removable;    /*  Lock for writing but not reading    */
     unsigned char no_more_additions:1;
 };

@@ -766,7 +765,6 @@
 {
     struct block_device_operations *ops;
     dev_t dev;
-    unsigned char removable:1;
 };

 struct cdev_type
@@ -1017,7 +1015,6 @@
  *     _devfs_append_entry - Append a devfs entry to a directory's child list.
  *     @dir:  The directory to add to.
  *     @de:  The devfs entry to append.
- *     @removable: If TRUE, increment the count of removable devices for %dir.
  *     @old_de: If an existing entry exists, it will be written here. This may
  *              be %NULL. An implicit devfs_get() is performed on this entry.
  *
@@ -1028,7 +1025,7 @@
  */

 static int _devfs_append_entry (devfs_handle_t dir, devfs_handle_t de,
-                               int removable, devfs_handle_t *old_de)
+                               devfs_handle_t *old_de)
 {
     int retval;

@@ -1056,7 +1053,6 @@
            if (dir->u.dir.first == NULL) dir->u.dir.first = de;
            else dir->u.dir.last->next = de;
            dir->u.dir.last = de;
-           if (removable) ++dir->u.dir.num_removable;
            retval = 0;
        }
        else retval = -EEXIST;
@@ -1095,13 +1091,13 @@
         == NULL ) return NULL;
     new->u.cdev.dev = devfs_alloc_devnum (S_IFCHR |S_IRUSR |S_IWUSR);
     new->u.cdev.ops = &devfsd_fops;
-    _devfs_append_entry (root_entry, new, FALSE, NULL);
+    _devfs_append_entry (root_entry, new, NULL);
 #ifdef CONFIG_DEVFS_DEBUG
     if ( ( new = _devfs_alloc_entry (".stat", 0, S_IFCHR | S_IRUGO | S_IWUGO) )
         == NULL ) return NULL;
     new->u.cdev.dev = devfs_alloc_devnum (S_IFCHR | S_IRUGO | S_IWUGO);
     new->u.cdev.ops = &stat_fops;
-    _devfs_append_entry (root_entry, new, FALSE, NULL);
+    _devfs_append_entry (root_entry, new, NULL);
 #endif
     return root_entry;
 }   /*  End Function _devfs_get_root_entry  */
@@ -1164,7 +1160,7 @@
        {
            de = _devfs_alloc_entry (name, next_pos, MODE_DIR);
            devfs_get (de);
-           if ( !de || _devfs_append_entry (dir, de, FALSE, &old) )
+           if ( !de || _devfs_append_entry (dir, de, &old) )
            {
                devfs_put (de);
                if ( !old || !S_ISDIR (old->mode) )
@@ -1498,7 +1494,6 @@
        de->u.bdev.dev = dev;
        de->u.cdev.autogen = devnum != 0;
        de->u.bdev.ops = ops;
-       if (flags & DEVFS_FL_REMOVABLE) de->u.bdev.removable = TRUE;
     } else {
        PRINTK ("(%s): illegal mode: %x\n", name, mode);
        devfs_put (de);
@@ -1516,7 +1511,7 @@
        de->inode.uid = 0;
        de->inode.gid = 0;
     }
-    err = _devfs_append_entry(dir, de, flags & DEVFS_FL_REMOVABLE, NULL);
+    err = _devfs_append_entry(dir, de, NULL);
     if (err)
     {
        PRINTK ("(%s): could not append to parent, err: %d\n", name, err);
@@ -1553,8 +1548,6 @@
     else de->next->prev = de->prev;
     de->prev = de;          /*  Indicate we're unhooked                      */
     de->next = NULL;        /*  Force early termination for <devfs_readdir>  */
-    if (S_ISBLK (de->mode) && de->u.bdev.removable )
-       --parent->u.dir.num_removable;
     return TRUE;
 }   /*  End Function _devfs_unhook  */

@@ -1648,7 +1641,7 @@
     de->info = info;
     de->u.symlink.linkname = newlink;
     de->u.symlink.length = linklength;
-    if ( ( err = _devfs_append_entry (dir, de, FALSE, NULL) ) != 0 )
+    if ( ( err = _devfs_append_entry (dir, de, NULL) ) != 0 )
     {
        PRINTK ("(%s): could not append to parent, err: %d\n", name, err);
        devfs_put (dir);
@@ -1725,7 +1718,7 @@
        return NULL;
     }
     de->info = info;
-    if ( ( err = _devfs_append_entry (dir, de, FALSE, &old) ) != 0 )
+    if ( ( err = _devfs_append_entry (dir, de, &old) ) != 0 )
     {
        PRINTK ("(%s): could not append to dir: %p \"%s\", err: %d\n",
                name, dir, dir->name, err);
@@ -1921,102 +1914,6 @@
 }   /*  End Function try_modload  */

-/**
- *     check_disc_changed - Check if a removable disc was changed.
- *     @de: The device.
- *
- *     Returns 1 if the media was changed, else 0.
- *
- *     This function may block, and may indirectly cause the parent directory
- *     contents to be changed due to partition re-reading.
- */
-
-static int check_disc_changed (struct devfs_entry *de)
-{
-       int tmp;
-       int retval = 0;
-       dev_t dev = de->u.bdev.dev;
-       extern int warn_no_part;
-
-       if (!S_ISBLK(de->mode))
-               return 0;
-       /* Ugly hack to disable messages about unable to read partition table */
-       tmp = warn_no_part;
-       warn_no_part = 0;
-       retval = __check_disk_change(dev);
-       warn_no_part = tmp;
-       return retval;
-}   /*  End Function check_disc_changed  */
-
-/**
- *     scan_dir_for_removable - Scan a directory for removable media devices and check media.
- *     @dir: The directory.
- *
- *     This function may block, and may indirectly cause the directory
- *     contents to be changed due to partition re-reading. The directory will
- *     be locked for reading.
- */
-
-static void scan_dir_for_removable (struct devfs_entry *dir)
-{
-    struct devfs_entry *de;
-
-    read_lock (&dir->u.dir.lock);
-    if (dir->u.dir.num_removable < 1) de = NULL;
-    else
-    {
-       for (de = dir->u.dir.first; de != NULL; de = de->next)
-       {
-           if (S_ISBLK (de->mode) && de->u.bdev.removable) break;
-       }
-       devfs_get (de);
-    }
-    read_unlock (&dir->u.dir.lock);
-    if (de) check_disc_changed (de);
-    devfs_put (de);
-}   /*  End Function scan_dir_for_removable  */
-
-/**
- *     get_removable_partition - Get removable media partition.
- *     @dir: The parent directory.
- *     @name: The name of the entry.
- *     @namelen: The number of characters in <<name>>.
- *
- *     Returns 1 if the media was changed, else 0.
- *
- *     This function may block, and may indirectly cause the directory
- *     contents to be changed due to partition re-reading. The directory must
- *     be locked for reading upon entry, and will be unlocked upon exit.
- */
-
-static int get_removable_partition (struct devfs_entry *dir, const char *name,
-                                   unsigned int namelen)
-{
-    int retval;
-    struct devfs_entry *de;
-
-    if (dir->u.dir.num_removable < 1)
-    {
-       read_unlock (&dir->u.dir.lock);
-       return 0;
-    }
-    for (de = dir->u.dir.first; de != NULL; de = de->next)
-    {
-       if (!S_ISBLK (de->mode) || !de->u.bdev.removable) continue;
-       if (strcmp (de->name, "disc") == 0) break;
-       /*  Support for names where the partition is appended to the disc name
-        */
-       if (de->namelen >= namelen) continue;
-       if (strncmp (de->name, name, de->namelen) == 0) break;
-    }
-    devfs_get (de);
-    read_unlock (&dir->u.dir.lock);
-    retval = de ? check_disc_changed (de) : 0;
-    devfs_put (de);
-    return retval;
-}   /*  End Function get_removable_partition  */
-
-
 /*  Superblock operations follow  */

 static struct inode_operations devfs_iops;
@@ -2166,7 +2063,6 @@
     switch ( (long) file->f_pos )
     {
       case 0:
-       scan_dir_for_removable (parent);
        err = (*filldir) (dirent, "..", 2, file->f_pos,
                          parent_ino (file->f_dentry), DT_DIR);
        if (err == -EINVAL) break;
@@ -2404,18 +2300,7 @@
     if (parent == NULL) return ERR_PTR (-ENOENT);
     read_lock (&parent->u.dir.lock);
     de = _devfs_search_dir (parent, dentry->d_name.name, dentry->d_name.len);
-    if (de) read_unlock (&parent->u.dir.lock);
-    else
-    {   /*  Try re-reading the partition (media may have changed)  */
-       if ( get_removable_partition (parent, dentry->d_name.name,
-                                     dentry->d_name.len) )  /*  Unlocks  */
-       {   /*  Media did change  */
-           read_lock (&parent->u.dir.lock);
-           de = _devfs_search_dir (parent, dentry->d_name.name,
-                                   dentry->d_name.len);
-           read_unlock (&parent->u.dir.lock);
-       }
-    }
+    read_unlock (&parent->u.dir.lock);
     lookup_info.de = de;
     init_waitqueue_head (&lookup_info.wait_queue);
     dentry->d_fsdata = &lookup_info;
@@ -2542,7 +2427,7 @@
     de = _devfs_alloc_entry (dentry->d_name.name, dentry->d_name.len, mode);
     if (!de) return -ENOMEM;
     de->vfs_deletable = TRUE;
-    if ( ( err = _devfs_append_entry (parent, de, FALSE, NULL) ) != 0 )
+    if ( ( err = _devfs_append_entry (parent, de, NULL) ) != 0 )
        return err;
     de->inode.uid = current->euid;
     de->inode.gid = current->egid;
@@ -2610,7 +2495,7 @@
        de->u.cdev.dev = rdev;
     else if (S_ISBLK (mode))
        de->u.bdev.dev = rdev;
-    if ( ( err = _devfs_append_entry (parent, de, FALSE, NULL) ) != 0 )
+    if ( ( err = _devfs_append_entry (parent, de, NULL) ) != 0 )
        return err;
     de->inode.uid = current->euid;
     de->inode.gid = current->egid;
===== fs/partitions/check.c 1.96 vs edited =====
--- 1.96/fs/partitions/check.c  Sat Mar  8 17:50:30 2003
+++ edited/fs/partitions/check.c        Wed Mar 12 10:35:00 2003
@@ -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)
-      
...

read more »

 
 
 

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Thu, 20 Mar 2003 23:50:18


: > 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

--
  Matthew Harrell                          If at first you don't succeed,
  Bit Twiddlers, Inc.                       try management.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Fri, 21 Mar 2003 02:10:12


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

--
  Matthew Harrell                          If you can't convince them,
  Bit Twiddlers, Inc.                       confuse them...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Sat, 22 Mar 2003 05:00:14


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.  

--
  Matthew Harrell                          Dogs have masters,
  Bit Twiddlers, Inc.                       cats have staff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.65 jaz drive devfs oops

Post by Christoph Hellwi » Sat, 22 Mar 2003 11:10:08



> 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.

Quote:> 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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Sat, 22 Mar 2003 14:20:06


: > 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

--
  Matthew Harrell                          Every morning is the dawn of a
  Bit Twiddlers, Inc.                       new error.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.65 jaz drive devfs oops

Post by Matthew Harrel » Sat, 22 Mar 2003 16:50:07


: 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

--
  Matthew Harrell                          Do not meddle in the affairs of cats
  Bit Twiddlers, Inc.                       for they are subtle and will*

  oops.txt
1K Download

  oops-raw.txt
2K Download
 
 
 

1. 2.5.65: devfs+initrd oops

Hi,

i get the following oops while booting 2.5.65 (vanilla and -ac3). More infos
availible on request.

Thanks,
   Florian

RAMDISK: Compressed image found at block 0
Unable to handle kernel NULL pointer dereference at virtual address 00000000
 printing eip:
c010975d
*pde = 00000000
Oops: 0002 [#1]
CPU:    0
EIP:    0060:[<c010975d>]    Not tainted
EFLAGS: 00000002
EIP is at __down+0x5d/0x100
eax: c02fc7c0   ebx: c02fc7b4   ecx: c114fe60   edx: 00000000
esi: c02fc7b4   edi: 00000286   ebp: c7ece040   esp: c114fe54
ds: 007b   es: 007b   ss: 0068
Process swapper (pid: 1, threadinfo=c114e000 task=c7ece040)
Stack: 00000001 c7ece040 c0118fb0 c02fc7c0 00000000 63736964 69642f73
00306373
       c02fc7b4 c02fc7a0
Call Trace:
 [<c0118fb0>] default_wake_function+0x0/0x20
 [<c0109978>] __down_failed+0x8/0xc
 [<c01a1ce1>] .text.lock.util+0x55/0x64
 [<c016ff4a>] devfs_remove_partitions+0x7a/0x80
 [<c01704aa>] del_gendisk+0x8a/0xd0
 [<c0225fa9>] initrd_release+0x49/0x80
 [<c01454c5>] __fput+0x35/0xe0
 [<c010a86f>] syscall_call+0x7/0xb
 [<c0143f18>] filp_close+0x98/0xb0
 [<c0143f89>] sys_close+0x59/0x80
 [<c010a86f>] syscall_call+0x7/0xb
 [<c010509d>] init+0x3d/0x1a0
 [<c0105060>] init+0x0/0x1a0
 [<c0108ae1>] kernel_thread_helper+0x5/0x14

Code: 89 0a 8b 46 04 8d 50 01 89 56 04 eb 3c 8d b6 00 00 00 00 c7
 <0>Kernel panic: Attempted to kill init!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. FA311 NIC won't work in latest Debian

3. ide kernel panic: 2.5.64-ac3 2.5.65-ac1 2.5.65-mm4

4. Need help on xserver settings

5. [2.5.65] kexec for 2.5.65 available

6. Reading is much more interesting than TV (1355/1708)

7. small devfs patch for 2.5.65, plan to replace /sbin/hotplug

8. Fonts are gone in KDE2

9. 2.5.65 RCU oops.

10. 2.5.65: oops: EIP at current_kernel_time +0x0f/0x40

11. reiserfs oops [2.5.65]

12. Oops with pcmcia and 2.5.65

13. An oops while running 2.5.65-mm2