Blob Blame History Raw
diff -up nfs-utils-1.2.1/utils/mountd/v4root.c.orig nfs-utils-1.2.1/utils/mountd/v4root.c
--- nfs-utils-1.2.1/utils/mountd/v4root.c.orig	2010-02-04 10:38:01.766414000 -0500
+++ nfs-utils-1.2.1/utils/mountd/v4root.c	2010-02-04 10:39:16.373599000 -0500
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <string.h>
 
 #include <unistd.h>
 #include <errno.h>
@@ -28,6 +29,29 @@
 #include "pseudoflavors.h"
 #include "v4root.h"
 
+
+#include <sys/utsname.h>
+
+static inline unsigned int MAKE_VERSION(unsigned int p, unsigned int q,
+					unsigned int r)
+{
+	return (65536 * p) + (256 * q) + r;
+}
+
+static inline unsigned int linux_version_code(void)
+{
+	struct utsname my_utsname;
+	unsigned int p, q, r;
+
+	if (uname(&my_utsname))
+		return 0;
+
+	p = atoi(strtok(my_utsname.release, "."));
+	q = atoi(strtok(NULL, "."));
+	r = atoi(strtok(NULL, "."));
+	return MAKE_VERSION(p, q, r);
+}
+
 #ifndef _PATH_PSEUDO_ROOT
 #define _PATH_PSEUDO_ROOT		"/"
 #endif
@@ -109,6 +133,11 @@ v4root_support()
 	if (kernel_support != -1)
 		return kernel_support;
 
+	if (linux_version_code() >= MAKE_VERSION(2, 6, 33)) {
+		kernel_support = 1;
+		return kernel_support;
+	}
+
 	kernel_support = 0;
 	fp = fopen("/proc/fs/nfsd/exports", "r");
 	if (fp == NULL)
diff -up nfs-utils-1.2.1/utils/mount/stropts.c.orig nfs-utils-1.2.1/utils/mount/stropts.c
--- nfs-utils-1.2.1/utils/mount/stropts.c.orig	2010-02-04 10:38:01.774412000 -0500
+++ nfs-utils-1.2.1/utils/mount/stropts.c	2010-02-04 10:40:37.139334000 -0500
@@ -47,6 +47,10 @@
 #include "parse_dev.h"
 #include "conffile.h"
 
+#ifndef ESERVERFAULT
+#define ESERVERFAULT    526
+#endif
+
 #ifndef NFS_PROGRAM
 #define NFS_PROGRAM	(100003)
 #endif
@@ -658,8 +662,9 @@ static int nfs_try_mount(struct nfsmount
 				 * automatically export a pseudo root, retry
 				 * ENOENT errors using version 3. And for
 				 * Linux servers prior to 2.6.25, retry EPERM
+				 * Linux server after 2.6.33, retry ESERVERFAULT
 				 */
-				if (errno != ENOENT && errno != EPERM)
+				if (errno != ENOENT && errno != EPERM && errno != ESERVERFAULT)
 					break;
 			}
 		}