am-utils/am-utils-6.1.5-nolock-toplvl.patch

65 lines
2.2 KiB
Diff
Raw Normal View History

amd does not work with kernel 2.6.25
Just after start-up, one can find the following in /var/log/messages:
Jun 10 11:36:28 tantale amd[18589]: '/net': mount: No locks available
Jun 10 11:36:29 tantale kernel: Invalid hostname "pid18588@tantale:/net" in NFS lock request
From: Philippe Troin <phil@fifi.org>
Addresses: https://bugzilla.am-utils.org/show_bug.cgi?id=612
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=450754
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=640383
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=602938
---
amd/amfs_toplvl.c | 5 ++++-
amd/autil.c | 8 ++++++--
configure.in | 3 +++
3 files changed, 13 insertions(+), 3 deletions(-)
--- am-utils-6.1.5.orig/amd/amfs_toplvl.c
+++ am-utils-6.1.5/amd/amfs_toplvl.c
@@ -226,7 +226,10 @@ amfs_toplvl_mount(am_node *mp, mntfs *mf
MNTTAB_OPT_RETRANS, gopt.amfs_auto_retrans[AMU_TYPE_TOPLVL]);
xstrlcat(opts, toplvl_opts, sizeof(opts));
}
-
+#ifdef MNTTAB_OPT_NOLOCK
+ xstrlcat(opts, ",", sizeof(opts));
+ xstrlcat(opts, MNTTAB_OPT_NOLOCK, sizeof(opts));
+#endif /* MNTTAB_OPT_NOLOCK */
#ifdef MNTTAB_OPT_NOAC
if (gopt.auto_attrcache == 0) {
xstrlcat(opts, ",", sizeof(opts));
--- am-utils-6.1.5.orig/amd/autil.c
+++ am-utils-6.1.5/amd/autil.c
@@ -491,9 +491,13 @@ amfs_mount(am_node *mp, mntfs *mf, char
/*
* Make a ``hostname'' string for the kernel
+ *
+ * Linux kernel since v2.6.19-rc1 (commit 8dead0dbd478f35fd943f3719591e5af1ac0950d)
+ * does not accept '/' in hostname in NFS lock requests.
+ * -- kzak@redhat.com, 06-Oct-2010
*/
- xsnprintf(fs_hostname, sizeof(fs_hostname), "pid%ld@%s:%s",
- get_server_pid(), am_get_hostname(), dir);
+ xsnprintf(fs_hostname, sizeof(fs_hostname), "%s", am_get_hostname());
+
/*
* Most kernels have a name length restriction (64 bytes)...
*/
--- am-utils-6.1.5.orig/configure.in
+++ am-utils-6.1.5/configure.in
@@ -621,6 +621,9 @@ AC_CHECK_HEADERS([ \
# ifndef __KERNEL__
# define __KERNEL__
# endif /* __KERNEL__ */
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_LINUX_SOCKET_H
# include <linux/socket.h>
#endif /* HAVE_LINUX_SOCKET_H */