public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Iustin Pop <iusty-JC6qDa14zzLYtjvyW6yDsg@public.gmane.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: Problems with crossmnt since 1.2.1
Date: Mon, 1 Mar 2010 15:40:10 -0500	[thread overview]
Message-ID: <20100301204010.GE23539@fieldses.org> (raw)
In-Reply-To: <20100228100643.GG26178-kWFYwFCQMdQkLqoNrXjPMti2O/JbrIOy@public.gmane.org>

On Sun, Feb 28, 2010 at 11:06:43AM +0100, Iustin Pop wrote:
> Since nfs-utils 1.2.1, there are some problems with crossmnt usage. See
> Debian bug http://bugs.debian.org/567546, but in short the problem seems
> to be that sub-mounts (/a/b) take the top-level mount (/a) options
> instead of their own, due to a bug in how mountd generates the crossmnt
> subexports.
> 
> I checked that reverting the write_secinfo changes in commit
> bc0a6ab03089fc1ea4fea26ed9635c2cc918b01b fix the issue, but that might
> only be a side effect, not the actual cause.
> 
> A short test:
> - have /a and /a/b exported, with different flags (e.g. ro on /a, rw on
>   /a/b)
> - restart the mountd, clear exports, etc.
> - try a mount on the client of /a/b, it gets readonly
> - umount & remount, it's now r/w
> - however, clearing the kernel export table (exportfs -f), makes the
>   next mount again get read-only 
> 
> Disabling crossmnt fixes the issue completely, so I would venture to
> guess that the subexports creation code has some issue, but I don't know
> enough of this to be able to debug it.

Thanks for the report.  What's the latest nfs-utils version you've
tested?

On a quick skim of the latest code I see one clear bug
(path[strlen(path)] will never be '/'!), but that should have caused
crossmnt to never get enforced at all rather than to override anything.

Could you retest the latest from the upstream git, with this patch
applied, and see if the problem is still present?

Then if it is I'll try to go reproduce it myself....

--b.

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index d63e10a..ff27bbf 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -619,7 +619,7 @@ static int is_subdirectory(char *subpath, char *path)
 	int l = strlen(path);
 
 	return strcmp(subpath, path) == 0
-		|| (strncmp(subpath, path, l) == 0 && path[l] == '/');
+		|| (strncmp(subpath, path, l) == 0 && subpath[l] == '/');
 }
 
 static int path_matches(nfs_export *exp, char *path)

  parent reply	other threads:[~2010-03-01 20:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-28 10:06 Problems with crossmnt since 1.2.1 Iustin Pop
     [not found] ` <20100228100643.GG26178-kWFYwFCQMdQkLqoNrXjPMti2O/JbrIOy@public.gmane.org>
2010-03-01 20:40   ` J. Bruce Fields [this message]
2010-03-01 21:13     ` Iustin Pop
     [not found]       ` <20100301211306.GA16341-kWFYwFCQMdQkLqoNrXjPMti2O/JbrIOy@public.gmane.org>
2010-03-01 21:39         ` J. Bruce Fields
2010-03-01 21:41           ` Iustin Pop
     [not found]             ` <20100301214116.GB16341-kWFYwFCQMdQkLqoNrXjPMti2O/JbrIOy@public.gmane.org>
2010-03-01 21:52               ` J. Bruce Fields
2010-03-02  3:20         ` J. Bruce Fields
2010-03-07 19:54           ` Iustin Pop
     [not found]             ` <20100307195449.GE9237-kWFYwFCQMdQkLqoNrXjPMti2O/JbrIOy@public.gmane.org>
2010-03-07 20:06               ` J. Bruce Fields
2010-03-07 20:07                 ` [PATCH 1/3] mountd: fix path comparison for v4 crossmnt J. Bruce Fields
2010-03-07 20:08                   ` [PATCH 2/3] mountd: trivial: name parameters for clarity J. Bruce Fields
2010-03-07 20:08                     ` [PATCH 3/3] mountd: fix crossmnt options in v2/v3 case J. Bruce Fields
2010-03-07 21:25                       ` Neil Brown
     [not found]                         ` <20100308082516.260e5f70-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2010-03-07 21:58                           ` J. Bruce Fields
2010-03-07 23:10                             ` Neil Brown
     [not found]                               ` <20100308101014.14e635b2-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2010-03-08 18:21                                 ` J. Bruce Fields
2010-03-08 18:23                                   ` J. Bruce Fields
2010-03-08 18:30                                   ` Chuck Lever
2010-03-08 18:41                                     ` J. Bruce Fields
2010-03-08 18:45                                       ` Chuck Lever
2010-03-08 19:56                                       ` Steve Dickson
2010-03-08 20:04                     ` [PATCH 2/3] mountd: trivial: name parameters for clarity Steve Dickson
2010-03-08 20:04                   ` [PATCH 1/3] mountd: fix path comparison for v4 crossmnt Steve Dickson
2010-03-08 20:28                 ` Problems with crossmnt since 1.2.1 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=20100301204010.GE23539@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=iusty-JC6qDa14zzLYtjvyW6yDsg@public.gmane.org \
    --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