From: bfields@fieldses.org (J. Bruce Fields)
To: Alkis Georgopoulos <alkisg@gmail.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: bindfs over NFS shows the underlying file system
Date: Fri, 11 Oct 2019 12:47:22 -0400 [thread overview]
Message-ID: <20191011164722.GB19318@fieldses.org> (raw)
In-Reply-To: <ae761918-245e-e25c-7aab-dd465f7c2461@gmail.com>
On Fri, Oct 11, 2019 at 08:24:14AM +0300, Alkis Georgopoulos wrote:
> I'm not sure if this is an NFS issue, or a bindfs issue, or if I'm
> not using the appropriate NFS options.
>
> I export my /home via NFS with:
>
> /home *(rw,async,crossmnt,no_subtree_check,no_root_squash,insecure)
>
> Inside my /home I'm providing a shared folder with a bindfs mount:
>
> bindfs -u 1000 --create-for-user=1000 -g 100
> --create-for-group=100 -p 770,af-x /home/share /home/share
>
> I.e. this just sets fixed permissions for anything under /home/share.
>
> And finally I mount /home on some NFS client (or on localhost):
>
> mount -t nfs server:/home /home
>
> The problem is that /home/share on the client doesn't show the
> bindfs permissions, but it shows the underlying file system of the
> server's /home/share.
> The crossmnt NFS option follows submounts with other file systems,
> but not with bindfs.
>
> On the other hand, if the bindfs source is on a different file
> system than the bindfs target directory, everything works fine (i.e.
> bindfs /other/filesystem/share /home/share).
Huh. I wonder if nfsd is for some reason determining the existence of a
mountpoint by comparing some kind of filesystem id and not seeing a
change. Looking at the code to remind myself how this works....
nfsd_mountpoint() is using d_mountpoint() and follow_down(), which
should be right. Then it's making an upcall to mountd. That's handled
by nfs-utils/mountd/cache.c:nfsd_export().
The is_mountpoint() check there is indeed going to return false in your
case because it's just comparing inode and device numbers.... But I
think that case is only for the "mountpoint" export option.
So I think all that matters is that export_matches() does the right
thing, and it certainly looks like it does--it should succeed as long as
there's a parent directory that's exported with crossmnt.
There's some debugging you could try by looking at
net/sunrpc/nfsd.*/content or using strace to watch rpc.mountd's reads
and writes of net/sunrpc/nfsd.*/channel.
What version of nfs-utils are you on?
--b.
>
> Is there any way to configure either NFS or bindfs, so that this
> works when I only have one partition, i.e. when the share is on the
> same file system as /home?
>
> If anyone answers, please Cc me as I'm not in the list.
>
> Thank you very much,
> Alkis Georgopoulos
> LTSP developer
next prev parent reply other threads:[~2019-10-11 16:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 5:24 bindfs over NFS shows the underlying file system Alkis Georgopoulos
2019-10-11 16:47 ` J. Bruce Fields [this message]
2019-10-12 5:03 ` Alkis Georgopoulos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191011164722.GB19318@fieldses.org \
--to=bfields@fieldses.org \
--cc=alkisg@gmail.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).