From owner-freebsd-fs Mon Oct 7 16:52:48 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9752737B401; Mon, 7 Oct 2002 16:52:46 -0700 (PDT) Received: from client1.solarflare.com (client1.solarflare.com [216.237.3.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1D7C43E6A; Mon, 7 Oct 2002 16:52:23 -0700 (PDT) (envelope-from dima@trit.org) Received: from vagabond.solarflarecom.com (vagabond [10.20.40.41]) by client1.solarflare.com (8.12.1/8.12.1) with ESMTP id g97NpwWJ004149; Mon, 7 Oct 2002 16:51:58 -0700 (PDT) Received: from vagabond.solarflarecom.com (localhost [127.0.0.1]) by vagabond.solarflarecom.com (8.12.6/8.12.5) with ESMTP id g97Nq0cQ054869; Mon, 7 Oct 2002 23:52:00 GMT (envelope-from dima@trit.org) Received: (from dima@localhost) by vagabond.solarflarecom.com (8.12.6/8.12.6/Submit) id g97Npwlq054868; Mon, 7 Oct 2002 23:51:58 GMT X-Authentication-Warning: vagabond.solarflarecom.com: dima set sender to dima@trit.org using -f Date: Mon, 7 Oct 2002 23:51:58 +0000 From: Dima Dorfman To: Robert Watson Cc: Poul-Henning Kamp , fs@freebsd.org, mux@freebsd.org Subject: Re: Retrieving filesystem-specific mount parameters from the kernel Message-ID: <20021007235157.GA25653@trit.org> References: <9511.1033808190@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Robert Watson wrote: > > On Sat, 5 Oct 2002, Poul-Henning Kamp wrote: > > > In message <20021005064810.GF26530@trit.org>, Dima Dorfman writes: > > >[ rwatson cc'd because I want him to be aware of this possible abuse > > > of extended attributes. ] > > > > > >It is occasionally desirable to display filesystem-specific mount > > >parameters in the output of mount(8). For example, it would be useful > > >if one could tell whether an NFS mount was tcp or udp, v2 or v3, etc.; > > >likewise, it would be useful if one could tell which ruleset is > > >associated with a particular devfs mount. This kind of information is > > >traditionally included in 'struct statfs', but this doesn't scale well > > >(since it requires breaking the ABI whenever we add a new filesystem) > > >and doesn't work at all for third-party filesystems. I propose for > > >the filesystem to export this information via an extended attribute > > >(idea courtesy of Boris Popov). This is entirely backwards and > > >forwards compatible, and is easy to implement even in third-party > > >filesystems. > > > > I am not at all thrilled by this. > > > > First off, mux@'s new mount facility is very flexible and extensible to > > when it comes to mount options, and none of the information you mention > > above are unable to use that facility, in fact it could be argued that > > they should specifically use it. I'm somewhat confused by this. As far as I can tell, nmount(2) passes mount options *into* the kernel, and I'm trying to get that information *out* of the kernel. If you're talking about exporting the information in mnt_opt through some other interface (such as mine), then I agree that it is a good idea, and actually considered implementing that as a "default" action if the filesystem didn't override it (e.g., vfs_stdgetextattr() that exports the information in mnt_opt). It is not sufficient to *just* do this, however, since some of the information we may want to export is not something that would be passed in via nmount(2) (e.g., devfs ruleset number, or something else which may change during runtime). For this reason, I explicitly did not call what I'm exporting mount "options", but rather "parameters" (I realize that "option" and "parameter" are very close in meaning--I just wanted a different word). > > Second, I think this is simply not the kind of information which > > extended attributes should be used for. Extended attributes are used to > > store additional administrative information about a particular vnode, > > not to report how the vnode is used or configured. > > I tend to agree -- without nmount(), extended attributes might very well > be the best way to export this information. However, with nmount(), we > now have the ability to export arbitrary mount meta-data using a flexible > interface, and that's probably the way we should be handling NFS > mountpoint meta-data. Again, I'm confused about how one should use nmount(2) to export data out of the kernel. Looking at the prototype, this doesn't look like it's possible, but if I missed something, I'd be grateful if someone would set me on the right track (source or documentation references would be helpful). Thanks, Dima. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message