From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Staubach Subject: Re: NFS4 crack Date: Thu, 22 Sep 2005 13:38:46 -0400 Message-ID: <4332EC26.9010307@redhat.com> References: <1127407973.8365.26.camel@lade.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Bryan Henderson , Neil Brown , akpm@osdl.org, andros@citi.umich.edu, bfields@citi.umich.edu, Christoph Hellwig , linux-fsdevel@vger.kernel.org, Olaf Kirch Return-path: Received: from mx1.redhat.com ([66.187.233.31]:62667 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1030458AbVIVRjW (ORCPT ); Thu, 22 Sep 2005 13:39:22 -0400 To: Trond Myklebust In-Reply-To: <1127407973.8365.26.camel@lade.trondhjem.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Trond Myklebust wrote: >to den 22.09.2005 Klokka 09:28 (-0700) skreiv Bryan Henderson: > > > >>Maybe you could remind everyone why knfsd is in the kernel. If it's just >>speed, what if anything would have to change in the structure of a system >>to make it work as fast in user space? >> >> > >The main reason for keeping (part) of the NFS server in the kernel is >not speed, but coping with races. > >In particular note that all NFS operations on files take an opaque >filehandle argument rather than a path. For instance, the operation >CREATE takes a filehandle argument in order to determine the path of the >directory in which to create the file, then a string argument to >determine the filename. >The set of filesystem-supplied helper function that converts a >filehandle into a dentry means that knfsd can do this safely without >danger of racing with rename() calls, unlink(),... >Trying to do the same thing in userland would have to involve first >converting the filehandle into a pathname, and then calling a POSIX >function using that pathname which is obviously very race prone. > It seems to me that a "system call" could implemented which would allow a file to be "opened" via the file handle. But then, we would be back to the speed argument. Switching in and out of the kernel requires time and data copies, both of which are not good and would kill any possibilities of making the Linux NFS server competitive. ps