Re: [PATCH - nfs-utils] Fix fallback from tcp to udp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 02/17/2014 06:43 PM, NeilBrown wrote:
> 
> Protocol negotiation in mount.nfs does not correctly negotiate with a
> server which only support NFSv3 and UDP.
> 
> When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED
> it does not fall back to NFSv3, as this is not recognised as a
> "does not support NFSv4" error.
> However ECONNREFUSED is a clear indication that the server doesn't
> support TCP, and ipso facto does not support NFSv4.
> So ECONNREFUSED should trigger a fallback from v4 to v2/3.
I'm also pretty this is the error returned when the server is 
down or more pointy when server is rebooting... Do we really
want to fallback at this point?

Secondly, its worrisome to me that we keep making this fallback
list longer and longer... we really don't want to fall back
to v3 but I do understand we want to be compatible with 
older servers... 

steved. 
> 
> Once we allow that error, NFSv3 is attempted and mount.nfs talks to
> rpcbind and discovers that UDP should be used for v3 and the mount
> succeeds.
> 
> Signed-off-by: NeilBrown <neilb@xxxxxxx>
> Reported-by: Carsten Ziepke <kieltux@xxxxxxxxx>
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index a642394d2f5a..6d4fd70b7b9e 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -807,6 +807,9 @@ static int nfs_autonegotiate(struct nfsmount_info *mi)
>  		/* Linux servers prior to 2.6.25 may return
>  		 * EPERM when NFS version 4 is not supported. */
>  		goto fall_back;
> +	case ECONNREFUSED:
> +		/* UDP-Only servers won't support v4 */
> +		goto fall_back;
>  	default:
>  		return result;
>  	}
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux