From owner-freebsd-arch@FreeBSD.ORG Wed Mar 20 22:32:38 2013 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9F349BBE for ; Wed, 20 Mar 2013 22:32:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1168D1 for ; Wed, 20 Mar 2013 22:32:38 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 411331203C1; Wed, 20 Mar 2013 23:32:21 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 28A462848C; Wed, 20 Mar 2013 23:32:21 +0100 (CET) Date: Wed, 20 Mar 2013 23:32:21 +0100 From: Jilles Tjoelker To: Alfred Perlstein Subject: Re: Increase the mount path to MAXPATHLEN? Message-ID: <20130320223220.GA54813@stack.nl> References: <20130319201145.GA19260@ambrisko.com> <20130320211433.F1007@besplex.bde.org> <5149E257.7030906@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5149E257.7030906@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 22:32:38 -0000 On Wed, Mar 20, 2013 at 09:22:47AM -0700, Alfred Perlstein wrote: > This is the approach I would hope to see happen. Making a separate > syscall/method to return a MAXPATHLEN mount path based on fsid would be > very easy and result in a lot less compat cruft. > I think it's time to deprecate retrieval of the mount paths via statfs > and instead use another call as do most other unix-like OSes. I like this idea but if it is based on fsid it will only work for root. A lookup by st_dev can be allowed for all users but st_dev may be less unique. The lookup can probably be implemented as a sysctl. This idea also solves the potential problem of getfsstat(2) returning a very large amount of data if struct statfs contains 2K of buffers and there are many mounted filesystems. This would still be rather different from what Linux does. Linux does not have anything like our getfsstat(2). Instead, /etc/mtab or /proc/mounts contains an fstab-like list of mounts and df(1) calls statfs(2) for each of them. I don't like this because the statfs call will take vnode locks and does not support a MNT_NOWAIT flag, so it will break df -n. -- Jilles Tjoelker