Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1158299ybp; Fri, 11 Oct 2019 09:48:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaQtq19SSh1QGkoMmQqvcNFsAlVW9iPrl8jkztLOhhRausiCb+l6a8AtY2KYh8LbyNOD+w X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr14792778edb.129.1570812481605; Fri, 11 Oct 2019 09:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570812481; cv=none; d=google.com; s=arc-20160816; b=S/0wTiFWEa+z0OkLU5GPN6NS5FFcYah2vJUgfX1IEZf1eCea8xhIWBzu9Q0Xg1D1om c3M660HVgWKk8PLsNL7XfkgHWULwi5DZI5lKpA0ZcszqcRIunAt3wwKbVbd24zSgsbDR g8MB2Xa8lT25RKJu9mG23+Cr/akJ4vK8qr0236kmbUolIyOVgncgZfVKLyfUcnX/LVaX BtDw3HiXWS3GnN0H8dxxIik5ux2bk2m2Chg4+z/CgE26c+QujbcP95MGdctDA6di9nj8 mFlzLzM4dzohzt9r+QuzXDoZpuZdsLWEfAA6pV2PX0TnSi6F+u+xhfZ53b/H8knYLDIj 7PIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=wH8IAJabRq9Vt1aDy4Lv4BmAFJYwSITtuRf4D68Epvw=; b=QhFnebCOaulQYNy4gp3i0cEKAwWN6xnQBBAuoyCVjNwOIDM7i+VPjBoRtnen/ntrjS L6Omj9WU0gHAbZ3j3XvStcMSuVzJlINJNDcuYRQTB8NatlgCR5nAnyQtIFYJ1gFfrI4d YgZKK8GZOaZIfhLEMarL0dTdy+fhJW1vEa+p8HoDekda0rUrxfr8EtNhQSRViO+pSBT8 FlYpJsjVV3dcYEPP/cVcGJejOVh/sO+/W7heIz26e6G7C94oonm52uyoUy3xDAxcAqaU dFOTn46ia1+CQ/WHTY04DYgMpysmCauQHL5r2okRhlmixkoBjYELml8AHtb4R9TNlOXZ rL7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si5543743ejc.421.2019.10.11.09.47.28; Fri, 11 Oct 2019 09:48:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbfJKQrX (ORCPT + 99 others); Fri, 11 Oct 2019 12:47:23 -0400 Received: from fieldses.org ([173.255.197.46]:59044 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbfJKQrX (ORCPT ); Fri, 11 Oct 2019 12:47:23 -0400 Received: by fieldses.org (Postfix, from userid 2815) id CD21A1C97; Fri, 11 Oct 2019 12:47:22 -0400 (EDT) Date: Fri, 11 Oct 2019 12:47:22 -0400 To: Alkis Georgopoulos Cc: "linux-nfs@vger.kernel.org" Subject: Re: bindfs over NFS shows the underlying file system Message-ID: <20191011164722.GB19318@fieldses.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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