From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 7 21:46:32 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 824C34C2 for ; Thu, 7 Aug 2014 21:46:32 +0000 (UTC) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CD6E2B0C for ; Thu, 7 Aug 2014 21:46:31 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id l4so3230809lbv.30 for ; Thu, 07 Aug 2014 14:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HuYtbBX1DdGWPXmTNn1YYKIN8cHVtOuelRhXkChHxts=; b=VmHBs3zW2+FFBABk6pcbqtuCzGanvgBvyHRKj9Ka64PKW2FZoPG8ovNEWGJ69r/NDN IwiKpN/2VSBK7lvFHigOqOhZ32+B4j8RSSNy0QBwAM5qWwKNrDtGkhZh+nTVY5jSfqvq OEZSNv3OtzWnjq0NPQGNNEWghztUHzyT3+uHGN7lguG4J0phE4qhqtNaqODSWHuznayb Rd750oepsVcHJV3e1ub6digEEsBWR9gCtWILlgnzVlDMLem3iqH+Uv3Mt9gTERaf35Ja Auti4cex3xKKC3BF1OtHm2L3DigogOi2EKlWMUubAhWe3MxnqOCuQAkIlYRNHwIlB/xI y/cQ== MIME-Version: 1.0 X-Received: by 10.152.234.71 with SMTP id uc7mr18995189lac.22.1407447989888; Thu, 07 Aug 2014 14:46:29 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.114.81.73 with HTTP; Thu, 7 Aug 2014 14:46:29 -0700 (PDT) In-Reply-To: <53E3C44C.9000500@delphij.net> References: <53E3C44C.9000500@delphij.net> Date: Thu, 7 Aug 2014 14:46:29 -0700 X-Google-Sender-Auth: hkLO2z9w3mxvTUDrXCR8X2YOMtk Message-ID: Subject: Re: Where is loader.conf.gz? From: hiren panchasara To: Xin LI Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 21:46:32 -0000 On Thu, Aug 7, 2014 at 11:24 AM, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 08/07/14 11:11, hiren panchasara wrote: >> I am trying to netboot minnowboard max with loader.efi and then >> nfsmount the root fs from my FreeBSD-Current zfs laptop. >> >> It gets stuck right at "Loading /boot/defaults/loader.conf" >> >> Looking at tcpdump (on interface serving nfsd on laptop), it tries >> to find loader.conf.gz and fails. >> >> I've failed to find loader.conf.gz anywhere on box or in the source >> code. Where does it come from and who is looking for it? > > lib/libstand/gzipfs.c I think? (zf_open) > > It's weird that it didn't handle the ENOENT error, though... > Xin, You are right. lib/libstand/open.c: open() looks like this: /* pass file name to the different filesystem open routines */ besterror = ENOENT; for (i = 0; file_system[i] != NULL; i++) { fs = file_system[i]; error = (fs->fo_open)(file, f); <-----zf_open() is called which returns ENOENT if (error == 0) goto ok; if (error != EINVAL) besterror = error; } error = besterror; So, the error is ENOENT at this point. But it fails in what happens after this: fail: if ((f->f_flags & F_NODEV) == 0 && f->f_dev != NULL) f->f_dev->dv_close(f); if (error) devclose(f); Here, it gets into both if() conditions and stalls/hangs in the call to devclose(): int devclose(struct open_file *f) { if (f->f_devdata != NULL) { free(f->f_devdata); <-- hangs right here and never returns. } return (0); } It probably panics and doesn't tell me. I have to hard reset the board. Is it because we are trying to close something we couldn't open? cheers, Hiren