[934] in arla-drinkers
Re: Arla 0.25 on Linux 2.2.10 bug
daemon@ATHENA.MIT.EDU (Assar Westerlund)
Tue Jun 29 08:34:08 1999
From owner-arla-drinkers@stacken.kth.se Tue Jun 29 12:34:08 1999
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 25134 invoked from network); 29 Jun 1999 12:34:06 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
by bloom-picayune.mit.edu with SMTP; 29 Jun 1999 12:34:06 -0000
Received: (from majordom@localhost)
by sundance.stacken.kth.se (8.8.8/8.8.8) id LAA15469
for arla-drinkers-list; Tue, 29 Jun 1999 11:40:33 +0200 (MET DST)
Received: from assaris.sics.se (assaris.sics.se [193.10.66.108])
by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id LAA15459
for <arla-drinkers@stacken.kth.se>; Tue, 29 Jun 1999 11:39:06 +0200 (MET DST)
Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.7.3) id LAA46190; Tue, 29 Jun 1999 11:34:20 +0200 (CEST)
From: Assar Westerlund <assar@stacken.kth.se>
To: Martin Dickopp <martin@pktw16.phy.tu-dresden.de>
Cc: arla-drinkers@stacken.kth.se
Subject: Re: Arla 0.25 on Linux 2.2.10 bug
References: <Pine.LNX.4.10.9906290128530.433-100000@pktw16.phy.tu-dresden.de> <5l9093n0j7.fsf@assaris.sics.se>
Mime-Version: 1.0 (generated by tm-edit 7.68)
Content-Type: text/plain; charset=US-ASCII
Date: 29 Jun 1999 11:34:12 +0200
In-Reply-To: Assar Westerlund's message of "29 Jun 1999 05:33:32 +0200"
Message-ID: <5lemivbbai.fsf@assaris.sics.se>
Lines: 131
X-Mailer: Gnus v5.5/Emacs 19.34
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk
I wrote:
> > A related problem is that when a directory entry of a file with
> > a link count >= 3 is deleted, the link count of the remaining
> > directory entries is not decreased. However, when I remove one
> > of two directory entries of a file, the remaining one shows a
> > correct link count of 1. Unfortunately, I don't have a patch for
> > this.
>
> As you say, that's a little bit harder. I'll have to think about that
> some more.
Can you try the following patch?
/assar
Index: arlad/messages.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/arlad/messages.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -w -u -w -r1.134 -r1.135
--- messages.c 1999/06/29 02:28:18 1.134
+++ messages.c 1999/06/29 09:26:52 1.135
@@ -1325,12 +1325,16 @@
xfs_message_remove (int fd, struct xfs_message_remove *h, u_int size)
{
VenusFid *parent_fid;
+ VenusFid fid;
Result res;
CredCacheEntry *ce;
int ret;
- struct xfs_message_installdata msg;
+ struct xfs_message_installdata msg1;
+ struct xfs_message_installattr msg2;
struct xfs_message_header *h0 = NULL;
size_t h0_len = 0;
+ struct xfs_message_header *h1 = NULL;
+ size_t h1_len = 0;
parent_fid = (VenusFid *)&h->parent_handle;
@@ -1338,6 +1342,10 @@
assert (ce != NULL);
do {
+ res = cm_lookup (*parent_fid, h->name, &fid, &ce);
+ } while (try_again (&ret, &ce, &h->cred, parent_fid));
+
+ do {
res = cm_remove(*parent_fid, h->name, ce);
if (res.res)
@@ -1348,6 +1356,7 @@
if (res.res == 0) {
FCacheEntry *dir_entry;
+ FCacheEntry *limbo_entry;
ret = fcache_get (&dir_entry, *parent_fid, ce);
if (ret)
@@ -1361,9 +1370,9 @@
}
ret = dir_remove_name (dir_entry, h->name,
- &msg.cache_handle,
- msg.cache_name,
- sizeof(msg.cache_name));
+ &msg1.cache_handle,
+ msg1.cache_name,
+ sizeof(msg1.cache_name));
if (ret) {
fcache_release (dir_entry);
goto out;
@@ -1383,23 +1392,43 @@
}
#endif
- msg.flag = XFS_INVALID_DNLC;
- msg.node.tokens = res.tokens | XFS_DATA_R;
+ msg1.flag = XFS_INVALID_DNLC;
+ msg2.node.tokens = res.tokens | XFS_DATA_R;
fcacheentry2xfsnode (parent_fid,
&dir_entry->realfid,
- &dir_entry->status, &msg.node,
+ &dir_entry->status, &msg1.node,
dir_entry->acccache);
- msg.header.opcode = XFS_MSG_INSTALLDATA;
- h0 = (struct xfs_message_header *)&msg;
- h0_len = sizeof(msg);
+ msg1.header.opcode = XFS_MSG_INSTALLDATA;
+ h0 = (struct xfs_message_header *)&msg1;
+ h0_len = sizeof(msg1);
#else
break_callback (*parent_fid);
#endif
fcache_release(dir_entry);
+
+ ret = fcache_get (&limbo_entry, fid, ce);
+ if (ret)
+ goto out;
+
+ ret = fcache_get_attr (limbo_entry, ce);
+ if (ret) {
+ fcache_release (limbo_entry);
+ goto out;
}
+ msg2.header.opcode = XFS_MSG_INSTALLATTR;
+ msg2.node.tokens = limbo_entry->tokens;
+ fcacheentry2xfsnode (&fid,
+ &limbo_entry->realfid,
+ &limbo_entry->status, &msg2.node,
+ limbo_entry->acccache);
+ h1 = (struct xfs_message_header *)&msg2;
+ h1_len = sizeof(msg2);
+ fcache_release (limbo_entry);
+ }
+
out:
cred_free (ce);
xfs_send_message_wakeup_multiple (fd,
@@ -1408,6 +1437,7 @@
#if 1
h0, h0_len,
#endif
+ h1, h1_len,
NULL, 0);
return ret;
}