From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 5 01:23:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EEF6106566B for ; Sun, 5 Jun 2011 01:23:55 +0000 (UTC) (envelope-from mashtizadeh@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 250748FC08 for ; Sun, 5 Jun 2011 01:23:54 +0000 (UTC) Received: by qyk27 with SMTP id 27so1725494qyk.13 for ; Sat, 04 Jun 2011 18:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=MHWwU6sN8Wl/dSVALQSZ7o0Jtj0AKWGPk6flqZ/js6w=; b=EAW8w2/pSwPEwS/AFHCFbAkeLt/iVqPtiyGFG07QoVLNO098eBRGwLgmCTdE7vB6m2 L1AQfG9S81yrO4+AOHdctoPuRyr44Fc3gdVGnkBzHQv8PrSFTbAjmH03cM/lWtBSI/N9 gAnuZ9AdgT7HKv5LQoZDuUShF5y2Rr4+bAbtc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=sGbH16CJEKTjYDhFlja+B/G1VkofqrfxRZxV+fuSVfv5C1qDx+8GJ2v7em3EuTKKlt 8UahgFXmeLW+iuP2cHE4wxEMZlz5mbCBCABr4NkKGAICzGOO+Y+epbNVh/SUkBLZNli6 YPp1KXJw5744kroD1nE1ledBdW/7Mfgf1EFj0= MIME-Version: 1.0 Received: by 10.229.237.18 with SMTP id km18mr2493133qcb.126.1307237034190; Sat, 04 Jun 2011 18:23:54 -0700 (PDT) Received: by 10.229.10.10 with HTTP; Sat, 4 Jun 2011 18:23:54 -0700 (PDT) In-Reply-To: References: Date: Sun, 5 Jun 2011 01:23:54 +0000 Message-ID: From: Ali Mashtizadeh To: Benjamin Kaduk Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD Hackers Subject: Re: Opening files from within geom filters X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 01:23:55 -0000 Hi Benjamin, Thanks for the reference. I originally wanted to open an fd in userspace as suggested, but the alq(9) API did not support that. I guess I'll try adding a new alq creation function for this purpose. Similarly, geom did not support that as well. I guess I'll spend sometime on adding that infrastructure. Thanks, ~ Ali On Sun, Jun 5, 2011 at 12:01 AM, Benjamin Kaduk wrote: > On Sat, 4 Jun 2011, Ali Mashtizadeh wrote: > >> Hi Folks, >> >> I'm working on a small geom filter where I need to open a file with >> vn_open_cred, but this causes an assert because of a null pointer >> because g_run_event proc structure has null pointer for the current >> working directory. > > Hi Ali, > > In general, it is not recommended to open a file from within the kernel, due > to a multitude of complications and difficulties. > The old thread here: > http://lists.freebsd.org/pipermail/freebsd-hackers/2007-May/020544.html > may provide you with some other options to do what you're doing, and insight > from a previous time when this sort of question came up. > > -Ben Kaduk >