summaryrefslogtreecommitdiff
path: root/net/arla
diff options
context:
space:
mode:
authorwennmach <wennmach>2000-08-22 15:08:38 +0000
committerwennmach <wennmach>2000-08-22 15:08:38 +0000
commit988c9d3c0059df18c16acdeb8910b65df7dc8024 (patch)
tree7e4402baf190bcb2491a6a85b6e514519c63021f /net/arla
parent2a4000b7526d6f2f6ac6d8215f8e5961b5bb8262 (diff)
downloadpkgsrc-988c9d3c0059df18c16acdeb8910b65df7dc8024.tar.gz
Added three patches to deal with a potential deadlock situation, which may
arise when writing back data from a vnode failed because the ticket expired in the meantime. From arla-current, thanks to Assar Westerlund and Love.
Diffstat (limited to 'net/arla')
-rw-r--r--net/arla/files/patch-sum5
-rw-r--r--net/arla/patches/patch-ao44
-rw-r--r--net/arla/patches/patch-ap283
-rw-r--r--net/arla/patches/patch-aq34
4 files changed, 365 insertions, 1 deletions
diff --git a/net/arla/files/patch-sum b/net/arla/files/patch-sum
index a35ec066b95..f9822693140 100644
--- a/net/arla/files/patch-sum
+++ b/net/arla/files/patch-sum
@@ -1,4 +1,4 @@
-$NetBSD: patch-sum,v 1.6 2000/08/15 16:08:24 wennmach Exp $
+$NetBSD: patch-sum,v 1.7 2000/08/22 15:08:38 wennmach Exp $
MD5 (patch-aa) = e96c11332180783528b4f549cb7884a4
MD5 (patch-ab) = 380a7bf1be1293ef21eefdd8b6ca14bf
@@ -10,3 +10,6 @@ MD5 (patch-ag) = 75603787951f1d56abbbbdcca0ea92db
MD5 (patch-ah) = 8d39dc019cf603ebf3c3dd1792399d59
MD5 (patch-ak) = 35638f7dc4dd55a5541dd3832afb40fc
MD5 (patch-an) = 900bea40df1e484e7383400f11270f0f
+MD5 (patch-ao) = 2fa45b0737735d717ba682441677ebba
+MD5 (patch-ap) = 166a4fe39980f1e67ae36f7189b5ce16
+MD5 (patch-aq) = 515c59ff13d9941cbb8ce64f55e909ae
diff --git a/net/arla/patches/patch-ao b/net/arla/patches/patch-ao
new file mode 100644
index 00000000000..0daa46d65f9
--- /dev/null
+++ b/net/arla/patches/patch-ao
@@ -0,0 +1,44 @@
+$NetBSD: patch-ao,v 1.1 2000/08/22 15:08:45 wennmach Exp $
+
+Deal with a potential deadlock situation, which may arise when writing back
+data from a vnode failed because the ticket expired in the meantime.
+From arla-current, thanks to Assar and Love.
+
+Index: xfs_vnodeops-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_vnodeops-common.c,v
+retrieving revision 1.58
+diff -u -w -u -w -r1.58 xfs_vnodeops-common.c
+--- xfs/bsd/xfs_vnodeops-common.c 2000/08/02 00:58:09 1.58
++++ xfs/bsd/xfs_vnodeops-common.c 2000/08/17 00:30:23
+@@ -260,8 +260,17 @@
+ return 0;
+ }
+
+- if (xn->flags & XFS_DATA_DIRTY)
++ if (xn->flags & XFS_DATA_DIRTY) {
++#ifdef FSYNC_RECLAIM
++ /* writing back the data from this vnode failed */
++ if (waitfor & FSYNC_RECLAIM) {
++ printf("xfs_fsync: data lost, failed to write back\n");
++ xn->flags &= ~XFS_DATA_DIRTY;
++ return 0;
++ }
++#endif
+ error = do_fsync(xfsp, xn, cred, proc, XFS_WRITE | XFS_FSYNC);
++ }
+
+ return error;
+ }
+@@ -907,8 +916,9 @@
+ /* xn->cred not set -> NOCRED */
+
+ error = xfs_fsync_common(vp, xn->cred, /* XXX */ 0, p);
+- if (error)
+- XFSDEB(XDEBVNOPS, ("xfs_inactive: fsync failed: %d\n", error));
++ if (error) {
++ printf ("xfs_inactive: failed writing back data: %d\n", error);
++ }
+
+ #ifndef __osf__
+ xfs_vfs_unlock(vp, p);
diff --git a/net/arla/patches/patch-ap b/net/arla/patches/patch-ap
new file mode 100644
index 00000000000..ef938da51a8
--- /dev/null
+++ b/net/arla/patches/patch-ap
@@ -0,0 +1,283 @@
+$NetBSD: patch-ap,v 1.1 2000/08/22 15:08:45 wennmach Exp $
+
+Avoid deadlock situation.
+From arla-current via Assar and Love.
+
+Index: xfs_dev-bsd.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_dev-bsd.c,v
+retrieving revision 1.24
+diff -u -w -r1.24 xfs_dev-bsd.c
+--- xfs/bsd/xfs_dev-bsd.c 2000/07/22 03:59:04 1.24
++++ xfs/bsd/xfs_dev-bsd.c 2000/08/19 10:16:51
+@@ -50,7 +50,7 @@
+ {
+ XFSDEB(XDEBDEV, ("xfsopen dev = %d.%d, flag = %d, devtype = %d\n",
+ major(dev), minor(dev), flag, devtype));
+- return xfs_devopen_common(dev);
++ return xfs_devopen_common(dev, proc);
+ }
+
+ int
+Index: xfs_dev-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_dev-common.c,v
+retrieving revision 1.39
+diff -u -w -r1.39 xfs_dev-common.c
+--- xfs/bsd/xfs_dev-common.c 2000/07/17 16:23:47 1.39
++++ xfs/bsd/xfs_dev-common.c 2000/08/19 10:27:35
+@@ -92,7 +92,7 @@
+ * Only allow one open.
+ */
+ int
+-xfs_devopen_common(dev_t dev)
++xfs_devopen_common(dev_t dev, struct proc *p)
+ {
+ struct xfs_channel *chan;
+
+@@ -105,8 +105,10 @@
+ if (chan->status & CHANNEL_OPENED) {
+ XFSDEB(XDEBDEV, ("xfs_devopen: already open\n"));
+ return EBUSY;
+- } else
++ } else {
+ chan->status |= CHANNEL_OPENED;
++ chan->proc = p;
++ }
+
+ chan->message_buffer = xfs_alloc(MAX_XMSG_SIZE);
+
+@@ -372,7 +374,8 @@
+ */
+
+ int
+-xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size)
++xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size,
++ struct proc *proc)
+ {
+ int ret;
+ struct xfs_channel *chan = &xfs_channel[fd];
+Index: xfs_dev-osf.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_dev-osf.c,v
+retrieving revision 1.7
+diff -u -w -r1.7 xfs_dev-osf.c
+--- xfs/bsd/xfs_dev-osf.c 2000/03/18 00:51:40 1.7
++++ xfs/bsd/xfs_dev-osf.c 2000/08/19 10:17:25
+@@ -51,7 +51,7 @@
+ {
+ XFSDEB(XDEBDEV, ("xfsopen dev = %d.%d, flag = %d, format = %d\n",
+ major(dev), minor(dev), flag, format));
+- return xfs_devopen_common(dev);
++ return xfs_devopen_common(dev, u.u_procp);
+ }
+
+ static int
+Index: xfs_syscalls-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_syscalls-common.c,v
+retrieving revision 1.51
+diff -u -w -r1.51 xfs_syscalls-common.c
+--- xfs/bsd/xfs_syscalls-common.c 2000/08/02 00:06:16 1.51
++++ xfs/bsd/xfs_syscalls-common.c 2000/08/19 10:23:15
+@@ -462,7 +462,7 @@
+ msg.cred.uid = xfs_proc_to_ruid(p);
+ msg.cred.pag = xfs_get_pag(xfs_proc_to_cred(p));
+
+- error = xfs_message_rpc(0, &msg.header, sizeof(msg)); /* XXX */
++ error = xfs_message_rpc(0, &msg.header, sizeof(msg), p); /* XXX */
+ msg2 = (struct xfs_message_wakeup_data *) &msg;
+
+ if (error == 0)
+Index: xfs_vfsops-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_vfsops-common.c,v
+retrieving revision 1.27
+diff -u -w -r1.27 xfs_vfsops-common.c
+--- xfs/bsd/xfs_vfsops-common.c 2000/08/01 20:36:56 1.27
++++ xfs/bsd/xfs_vfsops-common.c 2000/08/19 10:23:23
+@@ -240,7 +240,7 @@
+ msg.header.opcode = XFS_MSG_GETROOT;
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = xfs_get_pag(cred);
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), proc);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ } while (error == 0);
+Index: xfs_vnodeops-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_vnodeops-common.c,v
+retrieving revision 1.59
+diff -u -w -r1.59 xfs_vnodeops-common.c
+--- xfs/bsd/xfs_vnodeops-common.c 2000/08/17 00:38:36 1.59
++++ xfs/bsd/xfs_vnodeops-common.c 2000/08/19 10:28:19
+@@ -71,7 +71,7 @@
+ msg.handle = xn->handle;
+ msg.tokens = tok;
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+@@ -103,7 +103,7 @@
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = pag;
+ msg.handle = xn->handle;
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ } else {
+@@ -132,7 +132,7 @@
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = pag;
+ msg.handle = xn->handle;
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ } else {
+@@ -163,7 +163,7 @@
+ msg.handle = xn->handle;
+ msg.tokens = tok;
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+@@ -229,7 +229,7 @@
+ vattr2xfs_attr(&xn->attr, &msg.attr);
+ msg.flag = flag;
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+@@ -432,7 +432,7 @@
+ }
+
+ XFS_TOKEN_CLEAR(xn, XFS_ATTR_VALID, XFS_ATTR_MASK);
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ }
+@@ -552,7 +552,7 @@
+ bcopy(cnp->cn_nameptr, msg.name, cnp->cn_namelen);
+ msg.name[cnp->cn_namelen] = '\0';
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), proc);
+
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+@@ -603,7 +603,7 @@
+ }
+
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+@@ -637,7 +637,7 @@
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = xfs_get_pag(cred);
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) &msg)->error;
+
+@@ -685,7 +685,7 @@
+ strncpy(msg.new_name, tname, 256);
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = xfs_get_pag(cred);
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) &msg)->error;
+
+@@ -722,7 +722,7 @@
+ msg.cred.uid = 0;
+ msg.cred.pag = XFS_ANONYMOUSID;
+ }
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ }
+@@ -749,7 +749,7 @@
+ strncpy(msg.name, name, 256);
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = xfs_get_pag(cred);
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) &msg)->error;
+
+@@ -823,7 +823,7 @@
+ msg.cred.uid = cred->cr_uid;
+ msg.cred.pag = xfs_get_pag(cred);
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+
+@@ -857,7 +857,7 @@
+ strncpy (msg.contents, target, sizeof(msg.contents));
+ msg.contents[sizeof(msg.contents) - 1] = '\0';
+
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), proc);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+
+@@ -998,7 +998,7 @@
+ msg.cred.uid = 0;
+ msg.cred.pag = XFS_ANONYMOUSID;
+ }
+- error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
++ error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg), p);
+ if (error == 0)
+ error = ((struct xfs_message_wakeup *) & msg)->error;
+ }
+Index: xfs/xfs_dev.h
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs/xfs_dev.h,v
+retrieving revision 1.13
+diff -u -w -r1.13 xfs_dev.h
+--- xfs/bsd/xfs/xfs_dev.h 2000/04/02 21:28:24 1.13
++++ xfs/bsd/xfs/xfs_dev.h 2000/08/19 10:26:53
+@@ -68,6 +68,7 @@
+ int status;
+ #define CHANNEL_OPENED 0x1
+ #define CHANNEL_WAITING 0x2
++ struct proc *proc;
+ };
+
+ extern struct xfs_channel xfs_channel[NXFS];
+@@ -108,7 +109,7 @@
+ xfs_outq(struct xfs_link *p);
+
+ int
+-xfs_devopen_common(dev_t dev);
++xfs_devopen_common(dev_t dev, struct proc *);
+
+ #ifndef __osf__ /* XXX - we should do the same for osf */
+ int xfs_devopen(dev_t dev, int flag, int devtype, struct proc *proc);
+@@ -131,7 +132,8 @@
+ xfs_message_send(int fd, struct xfs_message_header * message, u_int size);
+
+ int
+-xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size);
++xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size,
++ struct proc *p);
+
+ int
+ xfs_message_receive(int fd,
diff --git a/net/arla/patches/patch-aq b/net/arla/patches/patch-aq
new file mode 100644
index 00000000000..0f1499848a7
--- /dev/null
+++ b/net/arla/patches/patch-aq
@@ -0,0 +1,34 @@
+$NetBSD: patch-aq,v 1.1 2000/08/22 15:08:45 wennmach Exp $
+
+Avoid deadlock situation.
+From arla-current via Assar and Love.
+
+Index: xfs_dev-common.c
+===================================================================
+RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_dev-common.c,v
+retrieving revision 1.39
+diff -u -w -u -w -r1.39 xfs_dev-common.c
+--- xfs/bsd/xfs_dev-common.c 2000/07/17 16:23:47 1.39
++++ xfs/bsd/xfs_dev-common.c 2000/08/20 04:25:33
+@@ -383,12 +386,19 @@
+ sigset_t oldsigmask;
+ #endif /* HAVE_STRUCT_PROC_P_SIGMASK */
+ int catch;
+- struct proc *proc = xfs_curproc ();
+
+ XFSDEB(XDEBMSG, ("xfs_message_rpc opcode = %d\n", message->opcode));
+
++ if (proc == NULL)
++ proc = xfs_curproc();
++
+ if (!(chan->status & CHANNEL_OPENED)) /* No receiver? */
+ return ENODEV;
++
++ if (proc->p_pid == chan->proc->p_pid) {
++ printf("xfs_message_rpc: deadlock avoided\n");
++ return EDEADLK;
++ }
+
+ if (size < sizeof(struct xfs_message_wakeup)) {
+ printf("XFS PANIC Error: Message to small to receive wakeup, opcode = %d\n", message->opcode);
+