* [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors
@ 2017-05-04 14:37 Steve Dickson
2017-05-05 15:07 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2017-05-04 14:37 UTC (permalink / raw)
To: Linux NFS Mailing list
Commit 65ac59cd introduced code that tries v3 mounts
when the the v4 mount fails with ECONNREFUSED. This
code allows failing back to v3 to work correctly.
When the v3 mount fails the original errno value has
been over rewritten. In this case the errno value
needs to be restored to ECONNREFUSED.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/stropts.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a9ff95d..0fbb375 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -868,7 +868,10 @@ check_result:
result = nfs_try_mount_v4(mi);
if (result == 0 && errno != ECONNREFUSED)
goto check_result;
- }
+ } else if (result == 0)
+ /* Restore original errno with v3 failures */
+ errno = ECONNREFUSED;
+
return result;
default:
return result;
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors
2017-05-04 14:37 [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors Steve Dickson
@ 2017-05-05 15:07 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2017-05-05 15:07 UTC (permalink / raw)
To: Linux NFS Mailing list
On 05/04/2017 10:37 AM, Steve Dickson wrote:
> Commit 65ac59cd introduced code that tries v3 mounts
> when the the v4 mount fails with ECONNREFUSED. This
> code allows failing back to v3 to work correctly.
>
> When the v3 mount fails the original errno value has
> been over rewritten. In this case the errno value
> needs to be restored to ECONNREFUSED.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...
steved.
> ---
> utils/mount/stropts.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index a9ff95d..0fbb375 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -868,7 +868,10 @@ check_result:
> result = nfs_try_mount_v4(mi);
> if (result == 0 && errno != ECONNREFUSED)
> goto check_result;
> - }
> + } else if (result == 0)
> + /* Restore original errno with v3 failures */
> + errno = ECONNREFUSED;
> +
> return result;
> default:
> return result;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-05 15:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-04 14:37 [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors Steve Dickson
2017-05-05 15:07 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox