From owner-freebsd-current@FreeBSD.ORG Tue May 12 12:10:21 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 3CEBD6DD; Tue, 12 May 2015 12:10:21 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id D63071399; Tue, 12 May 2015 12:10:20 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2D/AwA4CE9V/95baINcg2NeBoMYwUQJgU4KhTdOAoFVFAEBAQEBAQGBCoQgAQEBAwEBAQEgBCcgCwUHDxgCAg0ZAikBCSYGCAcEARwEiAMIDbNXknoBAQEBAQEBAQEBAQEBAQEBAQEBGYEhihiEMwEBHDQHgmiBRQWWW4JGgU2DVj6DHIdqIoIGg3KDVSOCCRyBbiIxAQEBAQOBBTmBAQEBAQ X-IronPort-AV: E=Sophos;i="5.13,414,1427774400"; d="scan'208";a="210359025" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 12 May 2015 08:10:18 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 7FC3CB3F67; Tue, 12 May 2015 08:10:17 -0400 (EDT) Date: Tue, 12 May 2015 08:10:17 -0400 (EDT) From: Rick Macklem To: David Boyd Cc: Doug Rabson , freebsd current , Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= Message-ID: <1435928923.36294067.1431432617509.JavaMail.root@uoguelph.ca> In-Reply-To: <1431359362.10811.2.camel@gemini.bsd1.net> Subject: Re: nmount, mountd drops high order MNT_xx flags during a mount update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.11] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) 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: Tue, 12 May 2015 12:10:21 -0000 David Boyd wrote: > 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. > Thanks for testing it and confirming that the problem is what I thought it was. > I think (hope) that this is the correct fix and wonder if this fix > might > make it's way into an errata. > Well, at this point, it isn't obvious if it should even go in head/current. (See https://reviews.freebsd.org/D2506) The patch already in head/current (r281699) should fix your problem. (It stops mountd from updating non-exported mounts.) It has not been MFC'd, but I will look into that. I don't know if it could also be an errata. Since it now appears to be a fix for an observed bug and not just an optimization, maybe? rick > Thanks for the quick responses. > > David Boyd. > > _______________________________________________ > 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" >