Skip to contentSkip to conversation

mountd: regression in crossmounts

PATCH In review Steve Dickson 2 participants 7 messages Mar 23, 2013 – Mar 27, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mountd: regression in crossmounts

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.

---
 utils/mountd/cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/mountd/cache.c +4 -1
index c8aa46f..978698d 100644
@@ -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 {
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 8 lines · Steve Dickson

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)

Quoted 8 lines

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.

Committed...

steved.

Quoted 22 lines
---
 utils/mountd/cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/mountd/cache.c +4 -1
index c8aa46f..978698d 100644
@@ -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 {
#2 lore raw
In reply to Steve Dickson
Quoted 10 lines · Steve Dickson

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.

Quoted 3 lines

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.

Quoted 31 lines
---
 utils/mountd/cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/mountd/cache.c +4 -1
index c8aa46f..978698d 100644
@@ -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 {
Signature · 6 lines
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 5 lines · J. Bruce Fields
Quoted 4 lines · Steve Dickson

commit 8e2fb3fc cause a regression in mount export that are on different local file system. Exports like (all on different filesystems)

Quoted 8 lines
Quoted 6 lines

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

Yeah... I had this guy reporting from day one that the latest nfs-utils broke his export world...

Quoted 7 lines
Quoted 4 lines

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.

The reason I didn't debug this further was I did not know how to reproduce the original problem the patch was trying to fix...

steved.

#4 lore raw
Quoted 20 lines · Steve Dickson
Quoted 5 lines · J. Bruce Fields
Quoted 4 lines · Steve Dickson

commit 8e2fb3fc cause a regression in mount export that are on different local file system. Exports like (all on different filesystems)

Quoted 8 lines
Quoted 6 lines

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

Yeah... I had this guy reporting from day one that the latest nfs-utils broke his export world...

Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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.

The reason I didn't debug this further was I did not know how to reproduce the original problem the patch was trying to fix...

Could you remind me where the bug report for this is?

The patch reverted here seems obviously correct to me, so I'm concerned.

--b.

#5 lore raw
Quoted 25 lines · J. Bruce Fields
Quoted 24 lines · Steve Dickson
Quoted 5 lines · J. Bruce Fields
Quoted 4 lines · Steve Dickson

commit 8e2fb3fc cause a regression in mount export that are on different local file system. Exports like (all on different filesystems)

Quoted 8 lines
Quoted 6 lines

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

Yeah... I had this guy reporting from day one that the latest nfs-utils broke his export world...

Quoted 5 lines
Quoted 4 lines

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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.

The reason I didn't debug this further was I did not know how to reproduce the original problem the patch was trying to fix...

Could you remind me where the bug report for this is?

Oh, right, it was https://bugzilla.redhat.com/show_bug.cgi?id=909882

I'm not seeing why you think this helps.

--b.

#6 lore raw
Quoted 28 lines · J. Bruce Fields
Quoted 27 lines · J. Bruce Fields
Quoted 26 lines · Steve Dickson
Quoted 5 lines · J. Bruce Fields
Quoted 4 lines · Steve Dickson

commit 8e2fb3fc cause a regression in mount export that are on different local file system. Exports like (all on different filesystems)

Quoted 8 lines
Quoted 6 lines

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

Yeah... I had this guy reporting from day one that the latest nfs-utils broke his export world...

Quoted 7 lines
Quoted 4 lines

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.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

The reason I didn't debug this further was I did not know how to reproduce the original problem the patch was trying to fix...

Could you remind me where the bug report for this is?

Oh, right, it was https://bugzilla.redhat.com/show_bug.cgi?id=909882

I'm not seeing why you think this helps.

Because it does... ;-)

     https://bugzilla.redhat.com/show_bug.cgi?id=909882#c10
     https://admin.fedoraproject.org/updates/FEDORA-2013-4396/nfs-utils-1.2.7-5.fc18

What I would like to is how to reproduce the original problem so we can fix it without creating this regression....

steved.