Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2013 23:32:21 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Alfred Perlstein <bright@mu.org>
Cc:        arch@FreeBSD.org
Subject:   Re: Increase the mount path to MAXPATHLEN?
Message-ID:  <20130320223220.GA54813@stack.nl>
In-Reply-To: <5149E257.7030906@mu.org>
References:  <20130319201145.GA19260@ambrisko.com> <20130320211433.F1007@besplex.bde.org> <5149E257.7030906@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130320223220.GA54813>