From owner-freebsd-current@FreeBSD.ORG Mon Oct 25 20:13:28 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320101065670; Mon, 25 Oct 2010 20:13:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 902868FC15; Mon, 25 Oct 2010 20:13:27 +0000 (UTC) Received: by fxm17 with SMTP id 17so3318662fxm.13 for ; Mon, 25 Oct 2010 13:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=SCkuYDvRoeYyyGDNd/tyFsLILTlo5/nZ5V/Uih9C0Rw=; b=UxRhLBGFZ8QzThPL9JsLB0yEJ0EdRtullJZAIrAV/Kxf8OhNNrzQRFmWbSxbP09RZ3 V4taHtXT6J5/GG6gUpe/EYACIHmymYdavhS+wiRTznxO/oMjl/Qs0GCia/x97AVf2g5d 1NrB8GhTempjbcg+/FziSspm/aaLKUwlOSPV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=cO8IuUeFHH9ndPs8CszFQV5vZpziocgKwuRGcvBhA9MkTssU3ASC85vayj5QF1dRFN JXdSdb7++B5ZyiZpUaSk3DYIQ1KFN5EDTcXXTVuj1e8+lHZ0ESLn9+ZvCRuptD07/DTU TXXDYWotrt3qUra5lBIUs+lXpkGHx0ZWVxYtQ= MIME-Version: 1.0 Received: by 10.216.161.17 with SMTP id v17mr853981wek.1.1288037606363; Mon, 25 Oct 2010 13:13:26 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Mon, 25 Oct 2010 13:13:26 -0700 (PDT) In-Reply-To: <4CC5D9DB.1020409@FreeBSD.org> References: <4CC5D83E.8030505@delphij.net> <4CC5D9DB.1020409@FreeBSD.org> Date: Mon, 25 Oct 2010 13:13:26 -0700 X-Google-Sender-Auth: dO8D0hDut5cLhdYuwmpaV8i-dXQ Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org Subject: Re: [RFC] More meaningful information about ENOEXEC for kldload(8) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 20:13:28 -0000 On Mon, Oct 25, 2010 at 12:26 PM, Doug Barton wrote: > On 10/25/2010 12:19, Xin LI wrote: >> >> Here is a simple patch that adds more meaning messages when kldload hits >> ENOEXEC. > > +1 on anything that makes this (and related) error more clear. I know I've > stumbled over it numerous times. Typo in the error message aside... Technically you can dig the source of these errors from /var/log/messages // syslog though, so why not just keep status quo? Making errors more intuitive is nice, but providing more misleading errors are worse than providing less misleading errors; this kind of error message falls in the more misleading message category, as ENOEXEC means: [ENOEXEC] The file format of file was unrecognized. That is open for a lot of interpretation as to what the actual error is, as this applies to the logic paths in /sys/kern/kern_linker.c:linker_load_file (to date) on CURRENT, which applies to both the child and parent modules. If anything though, I find this reasoning for hammering everything into ENOEXEC slightly annoying: /* * Format not recognized or otherwise unloadable. * When loading a module that is statically built into * the kernel EEXIST percolates back up as the return * value. Preserve this so that apps like sysinstall * can recognize this special case and not post bogus * dialog boxes. */ if (error != EEXIST) error = ENOEXEC; Why doesn't the error code properly percolate up the chain if it's not EEXIST -_-...? It's almost like there needs to be a more descriptive means to state what the errors are and those errors should be properly documented in the kldload(2) manpage. Thanks, -Garrett