Skip to contentSkip to conversation

RFC: export options for junctions

PATCH In review Chuck Lever 2 participants 11 messages Mar 2, 2012 – Apr 11, 2012

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

PATCH 1/1 RFC: export options for junctions

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

---

 utils/mountd/cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +1 -1
index ac9cdbd..35bc2e9 100644
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",
#1 lore raw

Bump.

Any ideas? Bueller? Anyone?

Quoted 38 lines · Chuck Lever

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +1 -2
index ac9cdbd..35bc2e9 100644
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",
 
--

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#2 lore raw
In reply to Chuck Lever
Quoted 9 lines · Chuck Lever

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Quoted 4 lines

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

I think you want to do something like the search in nfs-utils/utils/mountd/cache.c:lookup_export()--look for the export with the longest matching path, and copy options from that.

--b.

Quoted 21 lines

---

 utils/mountd/cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +1 -1
index ac9cdbd..35bc2e9 100644
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",
#3 lore raw

Hi-

Quoted 10 lines · J. Bruce Fields
Quoted 9 lines · Chuck Lever

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Quoted 8 lines
Quoted 4 lines

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

I think you want to do something like the search in nfs-utils/utils/mountd/cache.c:lookup_export()--look for the export with the longest matching path, and copy options from that.

This still looks hopelessly complex.

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#4 lore raw
Quoted 19 lines · Chuck Lever

Hi-

Quoted 15 lines · J. Bruce Fields
Quoted 13 lines · Chuck Lever

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

Quoted 5 lines
Quoted 3 lines

I think you want to do something like the search in nfs-utils/utils/mountd/cache.c:lookup_export()--look for the export with the longest matching path, and copy options from that.

This still looks hopelessly complex.

I bet there's an easy way to do it if we just modify the right code. Remind me where your nfs-utils patches live, and maybe I could take a look?

--b.

Quoted 48 lines

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#5 lore raw
Quoted 24 lines · J. Bruce Fields
Quoted 23 lines · Chuck Lever

Hi-

Quoted 18 lines · J. Bruce Fields
Quoted 9 lines · Chuck Lever

At Connectathon, I ran my FedFS-enabled client in a guest environment with NAT networking. This made the source port for my NFS connections unprivileged.

Attempting to access a junction on my test server failed with a "client insecure" error on the server, even if I specified the "insecure" export option on the parent export. I added "insecure" to the default junction export options, and this fixed the problem.

Quoted 4 lines

Bruce suggested, however, that the correct way to address this is to have junctions inherit the export options of their parent. I don't see a direct way to do this, so I'm posting this patch as a conversation starter.

I think you want to do something like the search in nfs-utils/utils/mountd/cache.c:lookup_export()--look for the export with the longest matching path, and copy options from that.

Quoted 5 lines
Quoted 1 line

This still looks hopelessly complex.

I bet there's an easy way to do it if we just modify the right code. Remind me where your nfs-utils patches live, and maybe I could take a look?

I admit to not being at all familiar with mountd's export cache, so I simply haven't found anything that appears to do what is needed.

Steve has already taken the basic junction support patch, so you can just grab a copy of the current nfs-utils git repo. Junction supported was added with commit ab74900f (according to my copy of his repo).

Thanks very much for your time.

Quoted 54 lines

--b.

Quoted 32 lines

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 19 lines

--b.

Quoted 17 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +1 -1
index ac9cdbd..35bc2e9 100644
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
Quoted 16 lines
Quoted 8 lines

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 4 lines
utils/mountd/cache.c +0 -0
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#6 lore raw
Quoted 9 lines · Chuck Lever
Quoted 6 lines · J. Bruce Fields
Quoted 5 lines · Chuck Lever

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

You should be able to skip steps 2 and 3 and use dupexportent.

Does that sound doable?

--b.

Quoted 54 lines
Quoted 46 lines
Quoted 26 lines

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 19 lines

--b.

Quoted 17 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +1 -1
index ac9cdbd..35bc2e9 100644
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
Quoted 16 lines
Quoted 8 lines

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 4 lines
utils/mountd/cache.c +0 -0
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#7 lore raw
Quoted 7 lines · J. Bruce Fields
Quoted 6 lines · Chuck Lever
Quoted 3 lines · J. Bruce Fields
Quoted 2 lines · Chuck Lever

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

You should be able to skip steps 2 and 3 and use dupexportent.

Does that sound doable?

The current junction lookup logic uses mkexportent(), which returns a statically allocated exportent that doesn't need to be freed. That makes the lookup_junction() call site simple, but that's too clever by half. Using dupexportent() unchanged would require some reworking there in order to free the duplicated exportent.

Also I'm not quite sure how to safely combine the use of mkexportent(), which parses the referral options we just created, and dupexportent(), which would duplicate the options from the parent, but would walk on e_hostname.

I could address both those problems by constructing a new function which was an amalgam of the two.

I still have to play with the lookup_export() logic to see how to find a junction's parent export.

Quoted 60 lines

--b.

Quoted 42 lines
Quoted 42 lines
Quoted 42 lines

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 12 lines
Quoted 4 lines

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#8 lore raw
Quoted 16 lines · Chuck Lever
Quoted 13 lines · J. Bruce Fields
Quoted 9 lines · Chuck Lever
Quoted 6 lines · J. Bruce Fields
Quoted 5 lines · Chuck Lever

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

You should be able to skip steps 2 and 3 and use dupexportent.

Quoted 7 lines
Quoted 1 line

Does that sound doable?

The current junction lookup logic uses mkexportent(), which returns a statically allocated exportent that doesn't need to be freed. That makes the lookup_junction() call site simple, but that's too clever by half. Using dupexportent() unchanged would require some reworking there in order to free the duplicated exportent.

Also I'm not quite sure how to safely combine the use of mkexportent(), which parses the referral options we just created, and dupexportent(), which would duplicate the options from the parent, but would walk on e_hostname.

I could address both those problems by constructing a new function which was an amalgam of the two.

updateexportent() might do the trick.

Quoted 74 lines

I still have to play with the lookup_export() logic to see how to find a junction's parent export.

Quoted 60 lines

--b.

Quoted 42 lines
Quoted 42 lines
Quoted 42 lines

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 12 lines
Quoted 4 lines

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 10 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
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
Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#9 lore raw
Quoted 21 lines · Chuck Lever
Quoted 18 lines · Chuck Lever
Quoted 14 lines · J. Bruce Fields
Quoted 9 lines · Chuck Lever
Quoted 6 lines · J. Bruce Fields
Quoted 5 lines · Chuck Lever

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

You should be able to skip steps 2 and 3 and use dupexportent.

Does that sound doable?

Quoted 7 lines
Quoted 5 lines

The current junction lookup logic uses mkexportent(), which returns a statically allocated exportent that doesn't need to be freed. That makes the lookup_junction() call site simple, but that's too clever by half. Using dupexportent() unchanged would require some reworking there in order to free the duplicated exportent.

Also I'm not quite sure how to safely combine the use of mkexportent(), which parses the referral options we just created, and dupexportent(), which would duplicate the options from the parent, but would walk on e_hostname.

I could address both those problems by constructing a new function which was an amalgam of the two.

updateexportent() might do the trick.

Any luck with that?

--b.

Quoted 83 lines
Quoted 75 lines

I still have to play with the lookup_export() logic to see how to find a junction's parent export.

Quoted 60 lines

--b.

Quoted 42 lines
Quoted 42 lines
Quoted 42 lines

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 12 lines
Quoted 4 lines

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 10 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
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
Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#10 lore raw
Quoted 24 lines · J. Bruce Fields
Quoted 23 lines · Chuck Lever
Quoted 20 lines · Chuck Lever
Quoted 7 lines · J. Bruce Fields
Quoted 6 lines · Chuck Lever
Quoted 3 lines · J. Bruce Fields
Quoted 2 lines · Chuck Lever

1. We have to create a version of lookup_export() that does exactly what's needed to find the junction's parent.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

2. Once we find the parent's exportent, we have to reverse parse the data in that exportent to get an options string, and concatenate that to the options string we're building for the junction itself.

3. Once we have the full options string for the junction, we use mkexportent() to convert it all back into another exportent. (or is there a simple way to merge the exportents?)

You should be able to skip steps 2 and 3 and use dupexportent.

Does that sound doable?

The current junction lookup logic uses mkexportent(), which returns a statically allocated exportent that doesn't need to be freed. That makes the lookup_junction() call site simple, but that's too clever by half. Using dupexportent() unchanged would require some reworking there in order to free the duplicated exportent.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Also I'm not quite sure how to safely combine the use of mkexportent(), which parses the referral options we just created, and dupexportent(), which would duplicate the options from the parent, but would walk on e_hostname.

I could address both those problems by constructing a new function which was an amalgam of the two.

updateexportent() might do the trick.

Any luck with that?

I've got some higher priority work that is blocking this. I may not get to it for a while.

Quoted 89 lines

--b.

Quoted 71 lines
Quoted 71 lines

I still have to play with the lookup_export() logic to see how to find a junction's parent export.

Quoted 60 lines

--b.

Quoted 42 lines
Quoted 42 lines
Quoted 42 lines

4. Then, we send the referral data to the kernel by converting that exportent back into a string with dump_to_cache().

For the time being, though a kludge, it seems easiest by far to simply stick the "insecure" option on all junctions. I don't think this is otherwise terribly risky.

Maybe at some later point we can think of a cleaner way to approach this? Is there a possible kernel solution for this (ie something that can be done in the kernel's export cache only for referrals)?

Quoted 27 lines

--b.

Quoted 13 lines

---

utils/mountd/cache.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
utils/mountd/cache.c +0 -0
index ac9cdbd..35bc2e9 100644

utils/mountd/cache.c locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations, · line 859

Quoted 8 lines
utils/mountd/cache.c +1 -1
@@ -853,7 +853,7 @@ locations_to_options(struct jp_ops *ops, nfs_fsloc_set_t locations,
 			ptr += len;
 		} else {
 			if (last_path == NULL)
-				len = snprintf(ptr, remaining, "refer=%s@%s",
+				len = snprintf(ptr, remaining, "insecure,refer=%s@%s",
 							rootpath, server);
 			else
 				len = snprintf(ptr, remaining, ":%s@%s",

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 12 lines
Quoted 4 lines

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 12 lines
Quoted 4 lines

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

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

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com