[326] in arla-drinkers
Patch for linux xfs driver
daemon@ATHENA.MIT.EDU (Trond Myklebust)
Thu Oct 15 19:49:40 1998
From owner-arla-drinkers@stacken.kth.se Thu Oct 15 23:49:39 1998
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 10115 invoked from network); 15 Oct 1998 23:49:38 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
by bloom-picayune.mit.edu with SMTP; 15 Oct 1998 23:49:38 -0000
Received: (from majordom@localhost)
by sundance.stacken.kth.se (8.8.8/8.8.8) id BAA08949
for arla-drinkers-list; Fri, 16 Oct 1998 01:43:26 +0200 (MET DST)
Received: from charged.uio.no (9727@charged.uio.no [129.240.86.49])
by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id BAA08939
for <arla-drinkers@stacken.kth.se>; Fri, 16 Oct 1998 01:43:02 +0200 (MET DST)
Received: (from trondmy@localhost)
by charged.uio.no (8.8.7/8.8.7) id BAA02127;
Fri, 16 Oct 1998 01:43:01 +0200
Date: Fri, 16 Oct 1998 01:43:00 +0200 (CEST)
To: arla-drinkers@stacken.kth.se
Subject: Patch for linux xfs driver
X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid
Message-ID: <13862.33525.960105.889521@charged.uio.no>
Reply-To: trond.myklebust@fys.uio.no
From: Trond Myklebust <trond.myklebust@fys.uio.no>
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
boundary="Multipart_Fri_Oct_16_01:43:00_1998-1"
Content-Transfer-Encoding: 7bit
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk
--Multipart_Fri_Oct_16_01:43:00_1998-1
Content-Type: text/plain; charset=US-ASCII
Hi,
I've been having trouble with the odd spurious Oops when running
ARLA 0.13 on a linux 2.1.125 kernel. I think I've tracked it down to
various 'IS_ERR' macros 'Oops'ing due to positive error-values being
returned by ARLA routines.
Would somebody knowledgeable of ARLA internals please check the
following patch to 'xfs/linux' for correctness?
Cheers,
Trond
PS: Could you please CC any reply to me, since I'm not subscribed to
this list.
--Multipart_Fri_Oct_16_01:43:00_1998-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="arla-patch.pat"
Content-Transfer-Encoding: 7bit
diff -ur arla-0.13.orig/xfs/linux/xfs_inodeops.c arla-0.13/xfs/linux/xfs_inodeops.c
--- arla-0.13.orig/xfs/linux/xfs_inodeops.c Fri Oct 2 06:41:37 1998
+++ arla-0.13/xfs/linux/xfs_inodeops.c Thu Oct 15 22:38:56 1998
@@ -47,6 +47,10 @@
#include <linux/file.h>
#include <linux/mm.h>
+#if LINUX_VERSION_CODE >= 131451
+#define HAVE_NEW_FOLLOW_LINK 1
+#endif
+
RCSID("$Id: xfs_inodeops.c,v 1.56 1998/10/02 04:41:37 assar Exp $");
static int
@@ -151,7 +155,11 @@
int flag, int mode, struct inode ** res_inode);
#else
static struct dentry *
+#ifdef HAVE_NEW_FOLLOW_LINK
+xfs_follow_link(struct dentry *, struct dentry *, unsigned int);
+#else
xfs_follow_link(struct dentry *, struct dentry *);
+#endif
#endif /* LINUX2_1 */
#ifndef LINUX2_1
@@ -447,7 +455,7 @@
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
} else {
*result=XNODE_TO_VNODE(x);
(*result)->i_count++;
@@ -549,7 +557,7 @@
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
} while (error == 0);
done:
@@ -589,7 +597,7 @@
msg.tokens = tok;
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
}
else
{
@@ -630,7 +638,7 @@
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
if (error == 0)
xn->flags &= ~XFS_DATA_DIRTY;
@@ -686,7 +694,7 @@
msg.handle = xn->handle;
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
} else {
goto done;
}
@@ -715,7 +723,7 @@
msg.handle = xn->handle;
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
}
else {
goto done;
@@ -808,7 +816,7 @@
msg.tokens = tok;
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
}
else
{
@@ -1067,7 +1075,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
#ifndef LINUX2_1
if (error == 0)
@@ -1119,7 +1127,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
#ifndef LINUX2_1
xn_file = xfs_cache_lookup(xn, name, len);
@@ -1195,7 +1203,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
#ifndef LINUX2_1
xn_file = xfs_cache_lookup(VNODE_TO_XNODE(old_dir), old_name, old_len);
@@ -1265,7 +1273,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
#ifdef LINUX2_1
if (!DENTRY_TO_XDENTRY(dentry)->valid) {
printk("XFS Panic: dentry not valid\n");
@@ -1329,7 +1337,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
if (error == 0) {
#ifndef LINUX2_1
@@ -1390,7 +1398,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
#ifdef LINUX2_1
DENTRY_TO_XDENTRY(dentry)->requested = 0;
#endif /* LINUX2_1 */
@@ -1448,7 +1456,7 @@
msg.cred.pag = xfs_get_pag();
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0)
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
#ifdef LINUX2_1
if (!DENTRY_TO_XDENTRY(dentry)->valid) {
printk("XFS Panic: dentry not valid\n");
@@ -1708,7 +1716,11 @@
}
#else
static struct dentry *
+#ifdef HAVE_NEW_FOLLOW_LINK
+xfs_follow_link(struct dentry *dentry, struct dentry *base, unsigned int follow)
+#else
xfs_follow_link(struct dentry *dentry, struct dentry *base)
+#endif
{
char *buffer;
int error;
@@ -1734,7 +1746,11 @@
if (error <= MAXPATHLEN)
buffer[error]='\0';
XFSDEB(XDEBVNOPS, ("xfs_follow_link linkname: %s\n", buffer));
+#ifdef HAVE_NEW_FOLLOW_LINK
+ base = lookup_dentry(buffer, base, follow);
+#else
base = lookup_dentry(buffer, base, 1);
+#endif
xfs_free(buffer);
return base;
}
diff -ur arla-0.13.orig/xfs/linux/xfs_syscalls.c arla-0.13/xfs/linux/xfs_syscalls.c
--- arla-0.13.orig/xfs/linux/xfs_syscalls.c Sat Jul 25 23:23:12 1998
+++ arla-0.13/xfs/linux/xfs_syscalls.c Thu Oct 15 22:41:07 1998
@@ -353,7 +353,7 @@
error = xfs_message_rpc(0, &msg.header, sizeof(msg)); /* XXX */
msg2 = (struct xfs_message_wakeup_data *) &msg;
if (error == 0)
- error = msg2->error;
+ error = -msg2->error;
if (error == 0 && msg2->header.opcode == XFS_MSG_WAKEUP_DATA) {
if(copy_to_user(vice_ioctl.out, msg2->msg,
diff -ur arla-0.13.orig/xfs/linux/xfs_vfsops.c arla-0.13/xfs/linux/xfs_vfsops.c
--- arla-0.13.orig/xfs/linux/xfs_vfsops.c Fri Jul 24 06:06:39 1998
+++ arla-0.13/xfs/linux/xfs_vfsops.c Thu Oct 15 22:40:47 1998
@@ -128,7 +128,7 @@
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
XFSDEB(XDEBVFOPS, ("xfs_root xfs_message_rpc error = %d\n", error));
if (error == 0)
- error = ((struct xfs_message_wakeup *) &msg)->error;
+ error = -((struct xfs_message_wakeup *) &msg)->error;
XFSDEB(XDEBVFOPS, ("xfs_root xfs_message_wakeup error = %d\n", error));
} while (error == 0);
@@ -334,7 +334,7 @@
inode_setattr(inode, attr);
error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));
if (error == 0) {
- error = ((struct xfs_message_wakeup *) & msg)->error;
+ error = -((struct xfs_message_wakeup *) & msg)->error;
#ifndef LINUX2_1
inode->i_dirt = 0;
--Multipart_Fri_Oct_16_01:43:00_1998-1--