Missing exports(patch) + Ugh

Itai Nahshon (nahshon@actcom.co.il)
Wed, 18 Feb 1998 02:27:01 +0200


__cpu_logical_map and smp_num_cpus are used by the HiSax (ISDN) driver.
They need to be exported in order to use hisax as a module.
A patch was already posted for 2.1.82 but not included in the kernel
so far.

current_lock is used by scsi disk and cdrom drivers. I added blk.h
(where
it's defined) and fixed the declaration of set_device_ro() which caused
a
a compilation error.

After adding these (and the fix to SHM_SWP_TYPE) I get Ugh messages
when I try to use an ide cdrom with ide-scsi and the scsi cdrom driver.

The Ugh messages are always from the lock_kernel() inlined call in the
next system call after the call to open /dev/scd0.

In some cases (I'm not sure it is releted) I got a system hang
when repeating the same scenario.

To repeat:
compile support for ide-scsi and scsi cdrom as modules, then
rmmod ide-cd, modprobe ide-scsi, modprobe sr_mod, run this program:
main() {
int fd;
char buf[2048];

fd = open("/dev/scd0", 0);
read(fd, buf, 2048);
}

Itai.

diff -ur linux-2.1.87-orig/arch/i386/kernel/i386_ksyms.c
linux-2.1.87/arch/i386/kernel/i386_ksyms.c
--- linux-2.1.87-orig/arch/i386/kernel/i386_ksyms.c Tue Jan 27
20:34:29 1998
+++ linux-2.1.87/arch/i386/kernel/i386_ksyms.c Tue Feb 17 20:36:17 1998
@@ -64,6 +64,7 @@

#ifdef __SMP__
EXPORT_SYMBOL(apic_reg); /* Needed internally for the I386
inlines */
+EXPORT_SYMBOL(__cpu_logical_map);
EXPORT_SYMBOL(cpu_data);
EXPORT_SYMBOL_NOVERS(kernel_flag);
EXPORT_SYMBOL_NOVERS(active_kernel_processor);
diff -ur linux-2.1.87-orig/kernel/ksyms.c linux-2.1.87/kernel/ksyms.c
--- linux-2.1.87-orig/kernel/ksyms.c Thu Feb 5 22:21:15 1998
+++ linux-2.1.87/kernel/ksyms.c Tue Feb 17 20:58:35 1998
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
+#include <linux/blk.h>
#include <linux/cdrom.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
@@ -70,7 +71,7 @@
#endif

extern char *get_options(char *str, int *ints);
-extern void set_device_ro(int dev,int flag);
+extern void set_device_ro(kdev_t dev,int flag);
extern struct file_operations * get_blkfops(unsigned int);
extern int blkdev_release(struct inode * inode);
#if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE)
@@ -244,6 +245,7 @@
EXPORT_SYMBOL(init_buffer);
EXPORT_SYMBOL(max_sectors);
EXPORT_SYMBOL(max_readahead);
+EXPORT_SYMBOL(current_lock);

/* tty routines */
EXPORT_SYMBOL(tty_hangup);
@@ -301,6 +303,7 @@
EXPORT_SYMBOL(timer_table);

#ifdef __SMP__
+EXPORT_SYMBOL(smp_num_cpus);
/* Various random spinlocks we want to export */
EXPORT_SYMBOL(tqueue_lock);
EXPORT_SYMBOL(waitqueue_lock);

-- 
Itai Nahshon   nahshon@actcom.co.il
        Also   nahshon@vnet.ibm.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu