From 658dc98b89fa72ae55214bcb9d2b19669ceb8945 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Feb 04 2010 15:49:04 +0000 Subject: Updated mount.nfs and mountd to work with 2.6.33 kernels. --- diff --git a/nfs-utils-1.2.1-mount-kernel-33.patch b/nfs-utils-1.2.1-mount-kernel-33.patch new file mode 100644 index 0000000..987d363 --- /dev/null +++ b/nfs-utils-1.2.1-mount-kernel-33.patch @@ -0,0 +1,78 @@ +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 + #include + #include ++#include + + #include + #include +@@ -28,6 +29,29 @@ + #include "pseudoflavors.h" + #include "v4root.h" + ++ ++#include ++ ++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; + } + } diff --git a/nfs-utils.spec b/nfs-utils.spec index 3c00583..668995f 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser Name: nfs-utils URL: http://sourceforge.net/projects/nfs Version: 1.2.1 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 # group all 32bit related archs @@ -27,6 +27,7 @@ Patch201: nfs-utils-1.2.1-nfsd-bootfail.patch Patch300: nfs-utils-1.2.0-v4root-rel9.patch Patch301: nfs-utils-1.2.1-mount-eperm.patch +Patch302: nfs-utils-1.2.1-mount-kernel-33.patch Group: System Environment/Daemons Provides: exportfs = %{epoch}:%{version}-%{release} @@ -82,6 +83,8 @@ This package also contains the mount.nfs and umount.nfs program. %patch201 -p1 %patch300 -p1 +%patch301 -p1 +%patch302 -p1 # Remove .orig files find . -name "*.orig" | xargs rm -f @@ -253,6 +256,9 @@ fi %attr(4755,root,root) /sbin/umount.nfs4 %changelog +* Thu Feb 4 2010 Steve Dickson 1.2.1-5 +- Updated mount.nfs and mountd to work with 2.6.33 kernels. + * Thu Dec 10 2009 Steve Dickson 1.2.1-4 - Update the pseudo root to handle security flavors better.