From owner-freebsd-hackers@FreeBSD.ORG Thu May 11 13:40:57 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 1169316A47D for ; Thu, 11 May 2006 13:40:56 +0000 (UTC) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id 169C5442DD for ; Thu, 11 May 2006 13:20:40 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm513-1.comsys.ntu-kpi.kiev.ua (pm513-1.comsys.ntu-kpi.kiev.ua [10.18.52.101]) (authenticated bits=0) by comsys.ntu-kpi.kiev.ua (8.13.6/8.13.6) with ESMTP id k4BDZYLb096883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 May 2006 16:35:34 +0300 (EEST) Received: by pm513-1.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1001) id 53BB25C024; Thu, 11 May 2006 16:21:08 +0300 (EEST) Date: Thu, 11 May 2006 16:21:08 +0300 From: Andrey Simonenko To: Scott Long Message-ID: <20060511132108.GA1366@pm513-1.comsys.ntu-kpi.kiev.ua> References: <20060421095610.GA1137@pm513-1.comsys.ntu-kpi.kiev.ua> <44626AE8.8060102@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44626AE8.8060102@samsco.org> User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on comsys.ntu-kpi.kiev.ua X-Virus-Scanned: ClamAV 0.82/1456/Thu May 11 08:57:31 2006 on comsys.ntu-kpi.kiev.ua X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: Atomic updates of NFS export lists 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: Thu, 11 May 2006 13:41:24 -0000 On Wed, May 10, 2006 at 04:36:24PM -0600, Scott Long wrote: > >In my environment non-atomic updates of NFS export lists are not > >acceptable. So, I decided to correct this problem. As the result > >mountd, kern/vfs_export.c were completely rewritten, mount.h, > >vfs_mount.c and nfs_srvsubs.c also got changes. > > > >For details see kern/9619. > > > > I've been looking at this since my company is also running into these > problems. I've integrated your patchset into my tree, and I'll let you > know how it works after a few days of testing. One thing to note is > that you've significantly re-written much of mountd, as well as changed > the API/ABI a bit and removed some command line switches. I removed only the "-p " option from mountd. Initially I added several options for mountd to allow to specify UDP, TCP services, addresses and ports, but that gave many lines of code. One of examples of such code is located in nfsd.c. Sockconf library allows in a configuration file to specify all settings for sockets and an application can use getsockconf() function for getting all settings in a linked list (similar to the result of the getaddrinfo() function). One new important option is -t, which allows to check exports file and dump parsed configuration. I thought about changing format of exports file, but decided to not change anything (almost). > That makes it > less attractive for inclusion in RELENG_6, but is fine for 7-CURRENT. > With that in mind, you should switch over to using nmount() instead of > mount(), that way you can completely remove the per-filesystem handling > code that you added. What about using nfssvc(2) for this task? Yes it is possible to use nmount() and remove export_args from all filesystems, and remove mount_arg("export"...) from all vfs_cmount() implementation, but... New version of mountd is very strict about errors and does not ignore them. There is a race condition between parsing exports file, passing parsed configuration to the kernel and mounting/umounting filesystems. It is possible to make mount(8), umount(8) and mountd(8) to work synchronous, but this will require changing of mount(8) and umount(8). In current implementation there are several situations when mountd can exit with error, e.g. a filesystem was mounted and exported, then it was unmounted and mountd rereads exports file, since old filesystem does not exist any more, mountd will report about error (the kernel will refuse to clear export list for non-existent filesystem) and exit. This problem exist before. This question must be discussed. > If there is any way that you can trim the changes to just implement the > new export primitives and leave out the libsock stuff, it would be much > easier to justify getting into RELENG_6. This will make code a bit complex as it is now... The idea of sockconf library is to simplify some part of code in applications. > I don't have an opinion on the > libsock design, but you should talk to people like Robert Watson about > that before this goes into 7-CURRENT. Can you and others also discuss "open questions" from the first letter?