linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mountd: regression in crossmounts
@ 2013-03-23 14:32 Steve Dickson
  2013-03-25 14:18 ` Steve Dickson
  2013-03-25 18:13 ` J. Bruce Fields
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Dickson @ 2013-03-23 14:32 UTC (permalink / raw)
  To: Linux NFS Mailing list

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

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

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-27 13:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).