linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: NeilBrown <neilb@suse.de>
Cc: Boaz Harrosh <openosd@gmail.com>, NFS <linux-nfs@vger.kernel.org>
Subject: Re: Should exportfs/mountd cope with case-insensitive directory names.
Date: Thu, 3 Apr 2014 17:36:10 -0400	[thread overview]
Message-ID: <20140403213610.GF8343@fieldses.org> (raw)
In-Reply-To: <20140404082154.4cfdab5a@notabene.brown>

On Fri, Apr 04, 2014 at 08:21:54AM +1100, NeilBrown wrote:
> On Thu, 3 Apr 2014 13:24:31 -0400 "J. Bruce Fields" <bfields@fieldses.org>
> wrote:
> 
> > On Thu, Apr 03, 2014 at 01:16:25PM -0400, J. Bruce Fields wrote:
> > > In the presence of bind mounts it's definitely possible for two
> > > different paths to reach the same directory.
> > > 
> > > I don't know if that's actually a problem here....
> > 
> > Without testing: if we've got the same filesystem mounted at /foo/bar
> > and /foo/baz, but only export /foo/bar, will this change make that
> > export show up at /foo/baz as well?
> > 
> > (Since we'll now consider /foo/bar and /foo/baz to match where
> > previously they didn't?)
> 
> Good question.  I should test, but I suspect "yes".  I'm not really happy
> about that.

Yeah.

> Maybe we could use name_to_handle_at().  That returns the mnt_id
> which is different for different bind mounts.
> So if the mnt_id and the handle are the same, it is the same directory.  If
> not, then not.
> 
> I did worry a bit about all the extra stat calls, but as you say: they are
> cached so it shouldn't be a big problem.
> 
> It would  make sense to stat (or name_to_handle_at) the name from the kernel
> just once, then compare the value against everything in the export table.
> 
> We could possible store handles in the export table, but then we would need
> to check for changes to mountinfo (I think 'poll' can do that) and clear out
> the cache whenever a mount changes.
> 
> I might play with some code if I find time...

Sounds reasonable.  But also getting a bit more involved for an uncommon
case (path to the root on a case-insensitive filesystem).

--b.

(BTW:  I also noticed the other day that systemd is calling
name_to_handle_at to get a mount id.  Seems like overkill in both
cases--shouldn't there be a simpler way to get just the mount id?)

  reply	other threads:[~2014-04-03 21:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03  5:46 Should exportfs/mountd cope with case-insensitive directory names NeilBrown
2014-04-03 13:09 ` J. Bruce Fields
2014-04-03 16:02   ` Boaz Harrosh
2014-04-03 17:16     ` J. Bruce Fields
2014-04-03 17:24       ` J. Bruce Fields
2014-04-03 21:21         ` NeilBrown
2014-04-03 21:36           ` J. Bruce Fields [this message]
2014-04-03 22:13             ` NeilBrown
2014-04-04 14:34               ` J. Bruce Fields

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=20140403213610.GF8343@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=openosd@gmail.com \
    /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).