From owner-cvs-src@FreeBSD.ORG Mon Oct 22 13:04:59 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 660CB16A46B; Mon, 22 Oct 2007 13:04:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 415B913C4A7; Mon, 22 Oct 2007 13:04:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 4F90146FE1; Mon, 22 Oct 2007 09:04:47 -0400 (EDT) Date: Mon, 22 Oct 2007 14:04:47 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Birrell In-Reply-To: <200710220413.l9M4D8g3016327@repoman.freebsd.org> Message-ID: <20071022135710.H70919@fledge.watson.org> References: <200710220413.l9M4D8g3016327@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/sys kldstat.2 src/sbin/kldstat kldstat.c src/sys/kern kern_linker.c src/sys/sys linker.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2007 13:04:59 -0000 On Mon, 22 Oct 2007, John Birrell wrote: > jb 2007-10-22 04:12:57 UTC > > FreeBSD src repository > > Modified files: > lib/libc/sys kldstat.2 > sbin/kldstat kldstat.c > sys/kern kern_linker.c > sys/sys linker.h > Log: > Add the full module path name to the kld_file_stat structure > for kldstat(2). > > This allows libdtrace to determine the exact file from which > a kernel module was loaded without having to guess. > > The kldstat(2) API is versioned with the size of the > kld_file_stat structure, so this change creates version 2. > > Add the pathname to the verbose output of kldstat(8) too. When using this function, keep in mind that, as with all stored path strings in the kernel, the string may become stale, be relative to a particular process cwd, or a particular process root. Automated use of similarly stored paths relating to mounted file systems are notoriously unreliable, especially if chroot() is in use. This doesn't make stored paths unuseful, just requires a little caution to make sure nothing relies on them working better than they actually do work. You might want to add a note in the BUGS or IMPLEMENTATION section to this extent. We had a rather nasty series of bugs in the user mount tool for a while in which an incorrect assumption was made that the path a file system was mounted as (and hence cached in the mount structure) would remain valid at unmount time -- as a result, file systems couldn't be unmounted from within chroots or if an intermediate directory in their path had been renamed. Robert N M Watson Computer Laboratory University of Cambridge