From owner-freebsd-current@FreeBSD.ORG Mon May 11 15:50:32 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02EABFF1 for ; Mon, 11 May 2015 15:50:32 +0000 (UTC) Received: from dnvrco-oedge-vip.email.rr.com (dnvrco-outbound-snat.email.rr.com [107.14.73.232]) by mx1.freebsd.org (Postfix) with ESMTP id BB26D150A for ; Mon, 11 May 2015 15:50:31 +0000 (UTC) Received: from [96.28.24.204] ([96.28.24.204:28658] helo=[192.168.209.109]) by dnvrco-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 77/D6-18241-38FC0555; Mon, 11 May 2015 15:49:24 +0000 Message-ID: <1431359362.10811.2.camel@gemini.bsd1.net> Subject: Re: nmount, mountd drops high order MNT_xx flags during a mount update From: David Boyd To: Rick Macklem Cc: Doug Rabson , freebsd current , Edward Tomasz =?UTF-8?Q?Napiera=C5=82a?= Date: Mon, 11 May 2015 11:49:22 -0400 In-Reply-To: <917688730.35175530.1431263274444.JavaMail.root@uoguelph.ca> References: <917688730.35175530.1431263274444.JavaMail.root@uoguelph.ca> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5 (3.8.5-31.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.64.130:25 X-Authority-Analysis: v=2.1 cv=XJy+SGRE c=1 sm=1 tr=0 a=LAeh8JulWguKKqZdjpwXog==:117 a=LAeh8JulWguKKqZdjpwXog==:17 a=ayC55rCoAAAA:8 a=IkcTkHD0fZMA:10 a=UNWf5WQ7AAAA:8 a=mjlnPRs6AAAA:8 a=6I5d2MoRAAAA:8 a=4RTEIeP134CyENfvOlIA:9 a=QEXdDO2ut3YA:10 X-Cloudmark-Score: 0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 15:50:32 -0000 On Sun, 2015-05-10 at 09:07 -0400, Rick Macklem wrote: > Oops, I did my usual and forgot to attach the patch. > > Here it is, rick > > ----- Original Message ----- > > Doug Rabson wrote: > > > You could add a single integer-valued vfsopt which holds the > > > high-order > > > bits of f_flags? > > > > > I have created a patch that does this. It is on > > https://reviews.freebsd.org/D2506 > > (I have also attached it here, for those who don't use Phabricator.) > > > > Please review/comment on this. (Feel free to add yourself as a > > reviewer, etc.) > > > > Also, David, if you can test this patch, it would be appreciated. > > > > Thanks for the suggestion Doug, rick > > > > > On 7 May 2015 at 02:10, Rick Macklem wrote: > > > > > > > David Boyd reported a problem to freebsd-current@ w.r.t. the > > > > MNT_AUTOMOUNTED > > > > flag getting cleared by mountd. > > > > http://docs.FreeBSD.org/cgi/mid.cgi?1429477202.29812.38.camel > > > > I just took a look at this and it's kinda ugly... > > > > > > > > mountd acquires a list of mounts via getmntinfo() and then does > > > > an > > > > nmount() for each of them to get rid of any exports. It uses > > > > f_flags from the statfs returned by getmntinfo() as the 3rd > > > > argument to nmount(). > > > > --> Since nmount()s 3rd argument is a "int", it silently drops > > > > any > > > > MNT_xx flag in the high order 32bits of f_flags. At this > > > > time, > > > > it happens that MNT_AUTOMOUNTED is the only one, but... > > > > > > > > I can think of a couple of ways to fix this, but I don't like any > > > > of > > > > them;-) > > > > > > > > 1) I suppose mountd could check for each flag set in f_flags and > > > > generate > > > > a vfsopts string for it, but that means that every time a new > > > > flag > > > > that > > > > can be updated is added to MNT_xx, this mountd.c code would have > > > > to > > > > updated. > > > > --> Ugly!! > > > > > > > > 2) Require that all flags in MNT_UPDATEMASK be in the low order > > > > 32bits. > > > > I wouldn`t mind this except in means that the MNT_xx flags > > > > must > > > > be > > > > redefined > > > > and I don`t think that could get MFC`d. > > > > > > > > 3) Add a new newernmount(2) which has a 64bit flags argument > > > > instead of > > > > int. > > > > > > > > Hopefully someone can think of a nice way to fix this, rick > > > > _______________________________________________ > > > > freebsd-current@freebsd.org mailing list > > > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > > > To unsubscribe, send any mail to > > > > "freebsd-current-unsubscribe@freebsd.org" > > > > > > > _______________________________________________ > > > freebsd-current@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > > To unsubscribe, send any mail to > > > "freebsd-current-unsubscribe@freebsd.org" > > > > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to > > "freebsd-current-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" Rick, Edward, et al, I have applied your patches to several (four) servers and have not noticed any more instances of the errant behavior. I think (hope) that this is the correct fix and wonder if this fix might make it's way into an errata. Thanks for the quick responses. David Boyd.