aboutsummaryrefslogtreecommitdiff
path: root/net/openafs
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2011-12-09 13:10:24 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2011-12-09 13:10:24 +0000
commit0bb429f334c4c84826f4dec80715babd9439f693 (patch)
tree84115ced6c9b8dd052b2e09fa3b4a521ba83b2ce /net/openafs
parentfcfabf26f037368258990e5de933a6ce48f5b628 (diff)
downloadports-0bb429f334c4c84826f4dec80715babd9439f693.tar.gz
ports-0bb429f334c4c84826f4dec80715babd9439f693.zip
Notes
Diffstat (limited to 'net/openafs')
-rw-r--r--net/openafs/Makefile2
-rw-r--r--net/openafs/files/patch-src__afs__FBSD__osi_vnodeops.c51
-rw-r--r--net/openafs/files/patch-src__afs__afs_server.c65
-rw-r--r--net/openafs/files/patch-src__rx__FBSD__rx_knet.c2
4 files changed, 111 insertions, 9 deletions
diff --git a/net/openafs/Makefile b/net/openafs/Makefile
index 2099ff94828f..8658ab98fd41 100644
--- a/net/openafs/Makefile
+++ b/net/openafs/Makefile
@@ -8,7 +8,7 @@
PORTNAME= openafs
DISTVERSION= ${AFS_DISTVERSION}.${DBVERSION:S/-//g}
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net kld
MASTER_SITES= http://dl.central.org/dl/openafs/${AFS_DISTVERSION}/:openafs \
http://dl.openafs.org/dl/openafs/${AFS_DISTVERSION}/:openafs \
diff --git a/net/openafs/files/patch-src__afs__FBSD__osi_vnodeops.c b/net/openafs/files/patch-src__afs__FBSD__osi_vnodeops.c
new file mode 100644
index 000000000000..b6fe1838e0e2
--- /dev/null
+++ b/net/openafs/files/patch-src__afs__FBSD__osi_vnodeops.c
@@ -0,0 +1,51 @@
+commit 8e14168c9c77850ce0603d56f8aa280f73cb3114
+Author: Ben Kaduk <kaduk@mit.edu>
+Date: Sun Nov 13 13:12:50 2011 -0500
+
+ FBSD: cleanup dvp locking for ISDOTDOT
+
+ This is a more correct version of
+ c2ed2577f9c16df3088158fb593d7aab6e8690d0, which was reverted since
+ it caused build issues on some versions and kernel panics on others.
+
+ We do want to always unlock dvp before calling over the network
+ in the ISDOTDOT case, but be sure to use the proper spelling
+ for this operation (as the syntax has changed between FreeBSD versions).
+ This requires not unlocking dvp right after the afs_lookup() call if
+ it succeeds, letting us just lock the "child" vp (which is actually
+ the parent starting from '/') first, and then re-lock dvp.
+
+ The error case of afs_lookup() was already handled correctly in
+ this logic, which is to say that it was incorrect before this change,
+ attempting to recursively lock dvp which causes a panic.
+
+ Change-Id: Ide29e47991413dadc3a2b5948f0f6c5bfa2911c4
+ Reviewed-on: http://gerrit.openafs.org/6127
+ Tested-by: BuildBot <buildbot@rampaginggeek.com>
+ Reviewed-by: Derrick Brashear <shadow@dementix.org>
+
+diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c
+index 311b5a9..a9be0c3 100644
+--- a/src/afs/FBSD/osi_vnodeops.c
++++ b/src/afs/FBSD/osi_vnodeops.c
+@@ -503,10 +503,8 @@ afs_vop_lookup(ap)
+
+ cnp->cn_flags |= MPSAFE; /* steel */
+
+-#ifndef AFS_FBSD70_ENV
+ if (flags & ISDOTDOT)
+- VOP_UNLOCK(dvp, 0, p);
+-#endif
++ MA_VOP_UNLOCK(dvp, 0, p);
+
+ AFS_GLOCK();
+ error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);
+@@ -531,7 +529,7 @@ afs_vop_lookup(ap)
+ * we also always return the vnode locked. */
+
+ if (flags & ISDOTDOT) {
+- MA_VOP_UNLOCK(dvp, 0, p);
++ /* vp before dvp since we go root to leaf, and .. comes first */
+ ma_vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ ma_vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+ /* always return the child locked */
diff --git a/net/openafs/files/patch-src__afs__afs_server.c b/net/openafs/files/patch-src__afs__afs_server.c
index ec52e26b24d7..d21f8055ba08 100644
--- a/net/openafs/files/patch-src__afs__afs_server.c
+++ b/net/openafs/files/patch-src__afs__afs_server.c
@@ -1,13 +1,64 @@
+commit 1ef8dc3dfbddcbe5610c276afc627c9fcfe30a65
+Author: Ben Kaduk <kaduk@mit.edu>
+Date: Sat Dec 3 14:37:09 2011 -0500
+
+ FBSD: switch afsi_SetServerIPRank implementation
+
+ Upstream has removed the ia_net{,mask} elements from
+ struct in_ifaddr, so we can no longer use them directly.
+ Switch to passing an rx_ifaddr_t (i.e. struct ifaddr*) in instead,
+ as that uses a slightly different codepath which still works
+ for our purposes.
+
+ We compile the kernel module with -Werror, so storing a pointer
+ (memcpy return value) in an int is forbidden, hence the conditional
+ declaration of 't'.
+
+ Change-Id: Ifefef88a353f4bd50a714ad88afa3a6f012fa3a1
+ Reviewed-on: http://gerrit.openafs.org/6203
+ Tested-by: BuildBot <buildbot@rampaginggeek.com>
+ Reviewed-by: Derrick Brashear <shadow@dementix.org>
+
diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c
-index ad28100..cafd355 100644
+index ad28100..3f4e8d2 100644
--- a/src/afs/afs_server.c
+++ b/src/afs/afs_server.c
-@@ -1032,7 +1032,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa)
+@@ -1025,7 +1025,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
+ return;
+ }
+ #else /* AFS_USERSPACE_IP_ADDR */
+-#if (! defined(AFS_SUN5_ENV)) && (! defined(AFS_DARWIN_ENV)) && (! defined(AFS_OBSD47_ENV)) && defined(USEIFADDR)
++#if (! defined(AFS_SUN5_ENV)) && (! defined(AFS_DARWIN_ENV)) && (! defined(AFS_OBSD47_ENV)) && (! defined(AFS_FBSD_ENV)) && defined(USEIFADDR)
+ void
+ afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa)
+ {
+@@ -1062,7 +1062,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa)
+ #endif /* IFF_POINTTOPOINT */
+ }
+ #endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) */
+-#if (defined(AFS_DARWIN_ENV) || defined(AFS_OBSD47_ENV)) && defined(USEIFADDR)
++#if (defined(AFS_DARWIN_ENV) || defined(AFS_OBSD47_ENV) || defined(AFS_FBSD_ENV)) && defined(USEIFADDR)
+ #ifndef afs_min
+ #define afs_min(A,B) ((A)<(B)) ? (A) : (B)
+ #endif
+@@ -1071,7 +1071,11 @@ afsi_SetServerIPRank(struct srvAddr *sa, rx_ifaddr_t ifa)
+ {
+ struct sockaddr sout;
struct sockaddr_in *sin;
++#if defined(AFS_DARWIN80_ENV) && !defined(UKERNEL)
int t;
++#else
++ void *t;
++#endif
-- if ((ntohl(sa->sa_ip) & ifa->ia_netmask) == ifa->ia_net) {
-+ if (1) {
- if ((ntohl(sa->sa_ip) & ifa->ia_subnetmask) == ifa->ia_subnet) {
- sin = IA_SIN(ifa);
- if (SA2ULONG(sin) == ntohl(sa->sa_ip)) { /* ie, ME!!! */
+ afs_uint32 subnetmask, myAddr, myNet, myDstaddr, mySubnet, netMask;
+ afs_uint32 serverAddr;
+@@ -1393,7 +1397,7 @@ afs_SetServerPrefs(struct srvAddr *sa)
+ #else
+ TAILQ_FOREACH(ifa, &in_ifaddrhead, ia_link) {
+ #endif
+- afsi_SetServerIPRank(sa, ifa);
++ afsi_SetServerIPRank(sa, &ifa->ia_ifa);
+ }}
+ #elif defined(AFS_OBSD_ENV)
+ {
diff --git a/net/openafs/files/patch-src__rx__FBSD__rx_knet.c b/net/openafs/files/patch-src__rx__FBSD__rx_knet.c
index 8a1b2ed31002..85d53d3bd81c 100644
--- a/net/openafs/files/patch-src__rx__FBSD__rx_knet.c
+++ b/net/openafs/files/patch-src__rx__FBSD__rx_knet.c
@@ -6,7 +6,7 @@ index c6d2d84..ded3f7c 100644
p = pfind(rxk_ListenerPid);
if (p) {
afs_warn("osi_StopListener: rxk_ListenerPid %u\n", rxk_ListenerPid);
-+#if (__FreeBSD_version >= 90004)
++#if (__FreeBSD_version >= 900044)
+ kern_psignal(p, SIGUSR1);
+#else
psignal(p, SIGUSR1);