Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2006 18:20:40 +0100
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        amd64@freebsd.org, Alexander Leidinger <Alexander@Leidinger.net>, current@freebsd.org
Subject:   Re: [panic] Re: small heads-up: Syncing amd64 GENERIC with i386 GENERIC (removing LINUX stuff)
Message-ID:  <20061203172040.GA51391@stud.fit.vutbr.cz>
In-Reply-To: <91817778@bsam.ru>
References:  <20061202160740.55046cc3@Magellan.Leidinger.net> <68623948@bsam.ru> <15016603_-_@bsam.ru> <20061203101418.GA20731@stud.fit.vutbr.cz> <91817778@bsam.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 03, 2006 at 05:06:37PM +0300, Boris Samorodov wrote:
> On Sun, 3 Dec 2006 11:14:18 +0100 Divacky Roman wrote:
> > On Sun, Dec 03, 2006 at 02:18:28AM +0300, Boris Samorodov wrote:
> > > On Sat, 02 Dec 2006 22:40:51 +0300 Boris Samorodov wrote:
> > > > On Sat, 2 Dec 2006 16:07:40 +0100 Alexander Leidinger wrote:
> > > 
> > > > > the linux module is now usable on amd64 (thanks to kib@ and his commit
> > > > > to the kernel linker in HEAD). 
> > > 
> > > > Cvsupped a couple of hours ago my amd64-current, rebuilt/reinstalled
> > > > world/kernel. The kernel is GENERIC without COMPAT_LINUX32, LINPROCFS,
> > > > LINSYSFS. But linux.ko hadn't been built. Should I cvsup once more or
> > > > did I miss something?
> > > 
> > > > I'd tested kib@ patches (about two weeks ago) and noticed that linux
> > > > kernel module can't be unloaded _after_ mounting/unmounting linprocfs,
> > > > linsysfs or linux devfs. Can anybody confirm?
> > > 
> > > OK, after cvsup and rebuild/install kernel I do:
> > > 
> > > # kldload linux
> > > # kldload linsysfs
> > > # kldunload linsysfs
> > > 
> > > and get a reprodusable panic:
> 
> > 1) if you have linux "module" built statically in kernel can you reproduce
> > this panic by kldload linsysfs && kldunload linsysfs?
> 
> The same panic.

so its not related to the recent commit and modulification of linux@amd64

I looked at the code from the bt and its like this:

TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) {
                TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next);
                free(scsi_host->path, M_TEMP);
                free(scsi_host, M_TEMP);
        }

I see two possible problems... 

1) the TAILQ_FOREACH is used when we remove the entry.. _SAFE variant should be used imho

2) there is no locking

can someone confirm me? if my analysis is correct - is changing it to _SAFE + possible
some locking enough?

roman

p.s. boris... can you try this patch:

Index: linsysfs.c
===================================================================
RCS file: /home/ncvs/src/sys/compat/linsysfs/linsysfs.c,v
retrieving revision 1.2
diff -u -r1.2 linsysfs.c
--- linsysfs.c	11 May 2006 15:27:58 -0000	1.2
+++ linsysfs.c	3 Dec 2006 17:20:14 -0000
@@ -268,9 +268,9 @@
 static int
 linsysfs_uninit(PFS_INIT_ARGS)
 {
-	struct scsi_host_queue *scsi_host;
+	struct scsi_host_queue *scsi_host, *scsi_host_tmp;
 
-	TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) {
+	TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, scsi_host_tmp) {
 		TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next);
 		free(scsi_host->path, M_TEMP);
 		free(scsi_host, M_TEMP);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061203172040.GA51391>