[panic] Re: small heads-up: Syncing amd64 GENERIC with i386
GENERIC (removing LINUX stuff)
Divacky Roman
xdivac02 at stud.fit.vutbr.cz
Sun Dec 3 09:21:07 PST 2006
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 at 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);
More information about the freebsd-amd64
mailing list