When v4 is specified on the command line the default minor version needs to be used. Signed-off-by: Steve Dickson <steved@xxxxxxxxxx> --- utils/mount/stropts.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 81fb945..d2d303f 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -119,14 +119,22 @@ static void nfs_default_version(struct nfsmount_info *mi) if (mi->version.v_mode == V_DEFAULT && config_default_vers.v_mode != V_DEFAULT) { mi->version.major = config_default_vers.major; - mi->version.minor = config_default_vers.minor; + if (config_default_vers.minor) + mi->version.minor = config_default_vers.minor; + else if (!mi->version.minor) + mi->version.minor = NFS_DEFAULT_MINOR; return; } if (mi->version.v_mode == V_GENERAL) { if (config_default_vers.v_mode != V_DEFAULT && - mi->version.major == config_default_vers.major) - mi->version.minor = config_default_vers.minor; + mi->version.major == config_default_vers.major) { + if (mi->version.minor) + mi->version.minor = config_default_vers.minor; + else if (!mi->version.minor) + mi->version.minor = NFS_DEFAULT_MINOR; + } else if (!mi->version.minor) + mi->version.minor = NFS_DEFAULT_MINOR; return; } @@ -740,10 +748,15 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi, } if (mi->version.v_mode != V_SPECIFIC) { - if (mi->version.v_mode == V_GENERAL) - snprintf(version_opt, sizeof(version_opt) - 1, - "vers=%lu", mi->version.major); - else + if (mi->version.v_mode == V_GENERAL) { + if (mi->version.major > 3) + snprintf(version_opt, sizeof(version_opt) - 1, + "vers=%lu.%lu", mi->version.major, + mi->version.minor); + else + snprintf(version_opt, sizeof(version_opt) - 1, + "vers=%lu", mi->version.major); + } else snprintf(version_opt, sizeof(version_opt) - 1, "vers=%lu.%lu", mi->version.major, mi->version.minor); -- 2.9.4 -- 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