From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Waychison Subject: Re: [PATCH 2.6.10-rd1-bk12] user-level lookup handler for tmpfs Date: Wed, 03 Nov 2004 11:38:40 -0500 Message-ID: <41890990.8080304@sun.com> References: <200411032158.iA3Lw5o01778@freya.yggdrasil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from brmea-mail-4.Sun.COM ([192.18.98.36]:26847 "EHLO brmea-mail-4.sun.com") by vger.kernel.org with ESMTP id S261704AbUKCQiw (ORCPT ); Wed, 3 Nov 2004 11:38:52 -0500 Received: from phys-mpk-2 ([129.146.11.82]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id iA3GcqNH000820 for ; Wed, 3 Nov 2004 09:38:52 -0700 (MST) Received: from conversion-daemon.mpk-mail1.sfbay.sun.com by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0I6M002013E1TN@mpk-mail1.sfbay.sun.com> (original mail from Michael.Waychison@Sun.COM) for linux-fsdevel@vger.kernel.org; Wed, 03 Nov 2004 08:38:51 -0800 (PST) In-reply-to: <200411032158.iA3Lw5o01778@freya.yggdrasil.com> To: "Adam J. Richter" Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Adam J. Richter wrote: > This patch eliminates the user level race condition that > I mentioned in my original trapfs announcement and which Michael > Waychison also complained out. Now, if an attempt is made to > open or stat a file name that is already blocking on a user > level helper, the new attempt will also invoke a user level > helper and block. > > A side effect of this is that, if a user level program > wants to create a plain text file, the helper program has to create > it with some file name that the program knows to ignore and then > rename them to the correct file names. This is because there is > nothing special about the user level helper program's attempts to > open the nonexistant files, so that open() invokes another instance > instance of a user level helper program, which needs to know to ignore > the file name. This should be pretty easy to do, and I've added an > untested hypothetical example of it to > Documentation/filesystems/lookup-trap.txt. So the ignoring is done by the userspace agent? > > If you want to have a directory tree that has no such file > names, then make it a "mount --bind" copy of a subdirectory of a > hidden tmpfs file system, something like this: > > mount -t tmpfs /hidden > mkdir /hidden/mirror /hidden/tmp-files > mount --bind /hidden/mirror /public > > ...and then have your user level helper program create > files in /hidden/tmp-files and move them to /hidden/mirror or /public > (makes no difference, although using /hidden/mirror would make it clearer > that the move is within the same file system). Stuff like moving a directory with a mountpoint on it can't be done (from userspace). This scheme would require doing an explicit mkdir and a mount --move. > > Serialization is up to the user level helper programs to deal > with if necessary. This approach not only keeps the kernel code > small, but also allows the user level helper programs to avoid > unnecessary serialization. > > Anyhow, here is the updated patch. Please let me know what > you think. I will probably post this and the devfs patch to > lkml soon for comments from a wider audience. > - -- Mike Waychison Sun Microsystems, Inc. 1 (650) 352-5299 voice 1 (416) 202-8336 voice ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBiQmQdQs4kOxk3/MRAo6rAJ907iugzAz6h/m9zvzO8dpvG+a3UACghljw aRWbEwiNizzvjat4r+1dYmg= =lwzL -----END PGP SIGNATURE-----