Ben Clifford wrote:
>
> Just to let you know - the bug is still there in 2.1.50. Oops attached,
> but it looks pretty much the same as always.
Hi Ben,
I've attached a patch for yet another try at tracking down the kswapd
bug. If you (and anyone else with this or similar bad-dentry oopses)
would give this a try -- if it triggers the diagnostic oops we'll know
where the problem is.
The patch works by poisoning all freed dentries, and then checking to
see if a reference is being added via dget().
Regards,
Bill
--------------90E6B1692800A76D35216622
Content-Type: text/plain; charset=us-ascii; name="dcache_50-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="dcache_50-patch"
--- linux-2.1.50/fs/dcache.c.old Thu Aug 14 18:44:06 1997
+++ linux-2.1.50/fs/dcache.c Sun Aug 17 14:36:07 1997
@@ -37,7 +37,23 @@
void d_free(struct dentry *dentry)
{
kfree(dentry->d_name.name);
+ /* poison the memory */
+ memset(dentry, 0xAB, sizeof(*dentry));
kfree(dentry);
+}
+
+struct dentry * dget(struct dentry *dentry)
+{
+ static int oopsed = 0;
+ if (dentry && dentry->d_count == 0xABABABAB) {
+ printk("dget: rereferencing dead dentry!\n");
+ if (!oopsed++)
+ *(int *) 0x12345678 = 0;
+ return NULL;
+ }
+ if (dentry)
+ dentry->d_count++;
+ return dentry;
}
/*
--- linux-2.1.50/include/linux/dcache.h.old Thu Aug 14 18:44:06 1997
+++ linux-2.1.50/include/linux/dcache.h Sun Aug 17 14:43:38 1997
@@ -124,6 +124,8 @@
/* write full pathname into buffer and return start of pathname */
extern char * d_path(struct dentry * entry, char * buf, int buflen);
+extern struct dentry * dget(struct dentry *dentry);
+#if 0
/* Allocation counts.. */
static inline struct dentry * dget(struct dentry *dentry)
{
@@ -131,6 +133,7 @@
dentry->d_count++;
return dentry;
}
+#endif
extern void dput(struct dentry *);
--------------90E6B1692800A76D35216622--