From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 21 15:16:43 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78E1616A4CE; Mon, 21 Feb 2005 15:16:43 +0000 (GMT) Received: from f26.mail.ru (f26.mail.ru [194.67.57.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 035FB43D3F; Mon, 21 Feb 2005 15:16:43 +0000 (GMT) (envelope-from shmukler@mail.ru) Received: from mail by f26.mail.ru with local id 1D3FIe-000D0P-00; Mon, 21 Feb 2005 18:16:40 +0300 Received: from [24.185.245.107] by win.mail.ru with HTTP; Mon, 21 Feb 2005 18:16:40 +0300 From: Igor Shmukler To: Robert Watson Mime-Version: 1.0 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [24.185.245.107] Date: Mon, 21 Feb 2005 18:16:40 +0300 In-Reply-To: Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Message-Id: cc: freebsd-hackers@freebsd.org Subject: Re[2]: vn_fullpath() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Igor Shmukler List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2005 15:16:43 -0000 Robert and David, Thank you for your help. > It depends a lot on the requirements. There are some nasty edge cases > where the process of determining a name for an object can be quite > expensive. Here's one of them: > > ln /usr/local/etc/apache/httpd.conf /usr/local/etc/apache.old/httpd.conf > reboot > apachectl start > rm /usr/local/etc/apache/httpd.conf > > Now generate the name of the file that Apache has open. Note that you > can't just look in the name cache, because the object has a name but the > name used to open the object has been invalidated. And UFS even knows it > has a name, because the link count remains non-zero when the unlink of one > of the names occurs -- but the only way it can find the other name is to > search the file system. > > So the first thing to do is to decied what your requirements are: are you > willing to fail in the edge cases like the above? If so, life is a lot > easier :-). I guess I am willing to fail :). Perhaps in some distant future, we will look into the nasty corner cases, but for now, as long as I get a name, it will do. We don't even mind the hardlinks so much, but we cannot afford to use existing vn_fullpath() because it does not guarantee "anything". Thank you, Igor