From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 25 15:32:28 2011 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792B2106566B; Sun, 25 Sep 2011 15:32:28 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id F087C8FC0C; Sun, 25 Sep 2011 15:32:27 +0000 (UTC) Received: by yxk36 with SMTP id 36so4750803yxk.13 for ; Sun, 25 Sep 2011 08:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=8SynN7BQtyKLsErnkV/lwM3cel0kR9njNFXYP5lICqE=; b=TjCOM2inUEAks2XuHiDay+agqm6g7Zl6XxBpfe7/dYODV6hrvfEzPiOgmtMqQ2EteD PEiFLsaSdlEPsYPoMQNnuHtGM5lRtPOIUZLlqNwru6Z1LRCpYPp+5ZNFKXhNI9YRP1Iw CZ2/YNpj4I+MGwDOZu9Uk2FebnTDzGpipPYf4= MIME-Version: 1.0 Received: by 10.42.148.7 with SMTP id p7mr5480694icv.191.1316964747189; Sun, 25 Sep 2011 08:32:27 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.229.4 with HTTP; Sun, 25 Sep 2011 08:32:27 -0700 (PDT) In-Reply-To: References: <201108102152.p7ALqUl4075207@red.freebsd.org> <201108102200.p7AM0Nu9026320@freefall.freebsd.org> Date: Sun, 25 Sep 2011 17:32:27 +0200 X-Google-Sender-Auth: qcz4iqtg2weZe2XCBN6yPm1DyVs Message-ID: From: Robert Millan To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Kostik Belousov , Josef Karthauser , Adrian Chadd , freebsd-fs@freebsd.org Subject: Re: kern/159663: sockets don't work though nullfs mounts X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2011 15:32:28 -0000 2011/9/24 Robert Millan : > I found a thread from 2007 with further discussion about this problem: > > http://lists.freebsd.org/pipermail/freebsd-fs/2007-February/002669.html Hi, I've looked at the situation in a bit more detail, for now only with sockets in mind (not named pipes). My understanding is (please correct me if I'm wrong): - nullfs holds reference counts for each vnode, but sockets have their own mechanism for reference counting (so_count / soref / sorele). vnode reference counting doesn't protect against socket being closed, which would leave a stale pointer in the upper nullfs layer. - Increasing the reference count of the socket itself can't be done in null_nodeget() because this function is merely a getter whose call doesn't indicate any meaningful event. - It's not clear to me that there's any event in time where the socket reference can be increased. If mounting a nullfs were that event, then all existing sockets would be soref'ed but we wouldn't be soref'ing future sockets created in the lower layer after the mount. This doesn't seem correct. - Possible solution: null_nodeget() semantics are replaced with something that actually allows vnodes in the upper layer to be created and destroyed. - Possible solution: upper layer has a memory structure to keep track of which sockets in the lower layer have been soref'ed.