Skip to contentSkip to conversation

mounts.nfs: v2 and v3 background mounts should retry when server is down.

PATCH In review Steve Dickson 2 participants 4 messages Apr 25, 2012 – May 1, 2012

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

PATCH 1/1 mounts.nfs: v2 and v3 background mounts should retry when server is down.

The point of background mounts is to have the mount retried if the mount fails. This patch allows the v2/v3 background mount to proceed in the case when the server is down by not making EOPNOTSUPP a permanent error.

---
 utils/mount/stropts.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
utils/mount/stropts.c +4 -2
index d52e21a..e09aa7c 100644
@@ -911,7 +911,8 @@ static int nfsmount_parent(struct nfsmount_info *mi)
 	if (nfs_try_mount(mi))
 		return EX_SUCCESS;
 
-	if (nfs_is_permanent_error(errno)) {
+	/* retry background mounts when the server is not up */
+	if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
 		mount_error(mi->spec, mi->node, errno);
 		return EX_FAIL;
 	}
@@ -946,7 +947,8 @@ static int nfsmount_child(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
-		if (nfs_is_permanent_error(errno))
+		/* retry background mounts when the server is not up */
+		if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
 			break;
 
 		if (time(NULL) > timeout)
Signature · 1 line
1.7.7.6
#1 lore raw

Hi-

Quoted 4 lines · Steve Dickson

The point of background mounts is to have the mount retried if the mount fails. This patch allows the v2/v3 background mount to proceed in the case when the server is down by not making EOPNOTSUPP a permanent error.

Just curious... why wouldn't we want to do this for foreground mounts as well?

Quoted 36 lines

---
utils/mount/stropts.c | 6 ++++--

1 files changed, 4 insertions(+), 2 deletions(-)
utils/mount/stropts.c +4 -2
index d52e21a..e09aa7c 100644
@@ -911,7 +911,8 @@ static int nfsmount_parent(struct nfsmount_info *mi)
 	if (nfs_try_mount(mi))
 		return EX_SUCCESS;
 
-	if (nfs_is_permanent_error(errno)) {
+	/* retry background mounts when the server is not up */
+	if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
 		mount_error(mi->spec, mi->node, errno);
 		return EX_FAIL;
 	}
@@ -946,7 +947,8 @@ static int nfsmount_child(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
-		if (nfs_is_permanent_error(errno))
+		/* retry background mounts when the server is not up */
+		if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
 			break;
 
 		if (time(NULL) > timeout)
Signature · 6 lines
1.7.7.6

--
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
Quoted 10 lines · Chuck Lever

Hi-

Quoted 4 lines · Steve Dickson

The point of background mounts is to have the mount retried if the mount fails. This patch allows the v2/v3 background mount to proceed in the case when the server is down by not making EOPNOTSUPP a permanent error.

Just curious... why wouldn't we want to do this for foreground mounts as well?

I had a similar thought but I was worried that it would change the current behavior that people are depending on... Giving the option of putting the mount in back ground to wait I thought was a good compromise...

steved.

#3 lore raw
In reply to Steve Dickson
Quoted 6 lines · Steve Dickson

The point of background mounts is to have the mount retried if the mount fails. This patch allows the v2/v3 background mount to proceed in the case when the server is down by not making EOPNOTSUPP a permanent error.

Committed...

steved.

Quoted 30 lines
---
 utils/mount/stropts.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
utils/mount/stropts.c +4 -3
index d52e21a..e09aa7c 100644
@@ -911,7 +911,8 @@ static int nfsmount_parent(struct nfsmount_info *mi)
 	if (nfs_try_mount(mi))
 		return EX_SUCCESS;
 
-	if (nfs_is_permanent_error(errno)) {
+	/* retry background mounts when the server is not up */
+	if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
 		mount_error(mi->spec, mi->node, errno);
 		return EX_FAIL;
 	}
@@ -946,7 +947,8 @@ static int nfsmount_child(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
-		if (nfs_is_permanent_error(errno))
+		/* retry background mounts when the server is not up */
+		if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
 			break;
 
 		if (time(NULL) > timeout)
-- 1.7.7.6 -- 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