From owner-freebsd-fs@FreeBSD.ORG Mon Sep 17 21:33:55 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0053A1065673 for ; Mon, 17 Sep 2012 21:33:54 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id D796E8FC15 for ; Mon, 17 Sep 2012 21:33:53 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8EAECWV1CDaFvO/2dsb2JhbAA+BxaFcbchgiABAQUjBFIbDgoCAg0ZAlkGiBMLp1SSc4EhigAhhTWBEgOVYoEUjw2DAoE+Ihs X-IronPort-AV: E=Sophos;i="4.80,439,1344225600"; d="scan'208";a="182014531" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 17 Sep 2012 17:32:44 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id C46C3B3EFE; Mon, 17 Sep 2012 17:32:44 -0400 (EDT) Date: Mon, 17 Sep 2012 17:32:44 -0400 (EDT) From: Rick Macklem To: Konstantin Belousov Message-ID: <1777840817.743780.1347917564789.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120917122325.GR37286@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: FS List Subject: Re: testing/review of atomic export update patch X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 21:33:55 -0000 Konstantin Belousov wrote: > On Sun, Sep 16, 2012 at 05:41:25PM -0400, Rick Macklem wrote: > > Hi, > > > > There is a simple patch at: > > http://people.freebsd.org/~rmacklem/atomic-export.patch > > that can be applied to a kernel + mountd, so that the new > > nfsd can be suspended by mountd while the exports are being > > reloaded. It adds a new "-S" flag to mountd to enable this. > > (This avoids the long standing bug where clients receive ESTALE > > replies to RPCs while mountd is reloading exports.) > > This looks simple, but also somewhat worrisome. What would happen > if the mountd crashes after nfsd suspension is requested, but before > resume was performed ? > > Might be, mountd should check for suspended nfsd on start and > unsuspend > it, if some flag is specified ? Well, I think that happens with the patch as it stands. suspend is done if the "-S" option is specified, but that is a no op if it is already suspended. The resume is done no matter what flags are provided, so mountd will always try and do a "resume". --> get_exportlist() is always called when mountd is started up and it does the resume unconditionally when it completes. If mountd repeatedly crashes before completing get_exportlist() when it is started up, the exports will be all messed up, so having the nfsd threads suspended doesn't seem so bad for this case (which hopefully never happens;-). Both suspend and resume are just no ops for unpatched kernels. Maybe the comment in front of "resume" should explicitly explain this, instead of saying resume is harmless to do under all conditions? Thanks for looking at it, rick