From owner-freebsd-stable Thu Dec 7 17:35:20 2000 From owner-freebsd-stable@FreeBSD.ORG Thu Dec 7 17:35:15 2000 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-176-64.dsl.snfc21.pacbell.net [63.202.176.64]) by hub.freebsd.org (Postfix) with ESMTP id 9CA1837B400; Thu, 7 Dec 2000 17:35:14 -0800 (PST) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.11.0/8.11.1) with ESMTP id eB81iXN00495; Thu, 7 Dec 2000 17:44:33 -0800 (PST) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200012080144.eB81iXN00495@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Jim Browne Cc: Matt Dillon , freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: More on BTX halted / crashes trying to use -stable /boot/loader In-reply-to: Your message of "Thu, 07 Dec 2000 16:29:49 PST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Dec 2000 17:44:33 -0800 From: Mike Smith Sender: msmith@mass.osd.bsdi.com Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is probably an OK workaround. I think that there's something fundamentally wrong with the 'net' filesystems getting called for an open against a disk device, but I've paged out all the libstand state and I can't get it back fast enough to comment more usefully. 8( BTW Jim, the stuff you're working on sounds really cool. Thanks for taking it on! > At 16:02 -0800 12/7/00, Jim Browne wrote: > >When TFTP tries to open a file, it is expecting struct open_file > >member f_devdata to be a pointer to a socket number. When currdev > >is "pxe", that assumption is correct. When currdev is "disk*", that > >assumption is incorrect. Specifically, tftp.c does: > > > >tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); > > > >In my case, that often winds up making tftpfile->iodesc = 0. That > >parameter is later passed in tftp_makereq to sendrecv as the iodesc, > >which via sendudp (and possibly the ARP functions) winds up calling > >netif_put. netif_put derefs the bogus iodesc to get a function > >pointer for the put function of the network interface and calls it. > >WHAM. QED. :) > > How does this look? > > *** tftp.c Thu Dec 7 16:20:02 2000 > --- tftp2.c Thu Dec 7 16:20:55 2000 > *************** tftp_open(path, f) > *** 257,260 **** > --- 257,262 ---- > > tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); > + if (io == NULL) > + return (EINVAL); > io->destip = servip; > tftpfile->off = 0; > > (I suppose I could have included this earlier. Ugh.) > > Jim Browne jbrowne@jbrowne.com > "We lost our lease. You lose culture" - sign on SF Arts Comission Bldg > -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message