All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Steve Dickson <steved@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] mountd: regression in crossmounts
Date: Mon, 25 Mar 2013 14:13:14 -0400	[thread overview]
Message-ID: <20130325181314.GA10120@fieldses.org> (raw)
In-Reply-To: <1364049149-3751-1-git-send-email-steved@redhat.com>

On Sat, Mar 23, 2013 at 10:32:29AM -0400, Steve Dickson wrote:
> commit 8e2fb3fc cause a regression in mount export
> that are on different local file system.
> Exports like (all on different filesystems)
> 
> /home *(rw,fsid=0,crossmnt)
> /home/fs1 *(rw,crossmnt)
> /home/fs1/fs2/fs3 *(rw,nohide)
> 
> and then a mount of the root 'mount /home /mnt'
> would end up mounting /home/fs1/fs2/fs3 not /home

That's strange.

> Reverting the logic of commit 8e2fb3fc until
> a better solution can be found for the original
> problem.

I can't figure out why the patch below would help.  The only change I
can see is to the way that an export of "/" would be handled.

--b.

> 
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  utils/mountd/cache.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
> index c8aa46f..978698d 100644
> --- a/utils/mountd/cache.c
> +++ b/utils/mountd/cache.c
> @@ -371,8 +371,11 @@ export_matches(nfs_export *exp, char *dom, char *path, struct addrinfo *ai)
>  static bool subexport(struct exportent *e1, struct exportent *e2)
>  {
>  	char *p1 = e1->e_path, *p2 = e2->e_path;
> +	size_t l2 = strlen(p2);
> +
>  	return e2->e_flags & NFSEXP_CROSSMOUNT
> -		&& is_subdirectory(p1, p2);
> +		&& strncmp(p1, p2, l2) == 0
> +		&& p1[l2] == '/';
>  }
>  
>  struct parsed_fsid {
> -- 
> 1.8.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-03-25 18:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 14:32 [PATCH] mountd: regression in crossmounts Steve Dickson
2013-03-25 14:18 ` Steve Dickson
2013-03-25 18:13 ` J. Bruce Fields [this message]
2013-03-25 20:22   ` Steve Dickson
2013-03-25 21:27     ` J. Bruce Fields
2013-03-25 23:36       ` J. Bruce Fields
2013-03-27 13:06         ` Steve Dickson

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=20130325181314.GA10120@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.