[PATCH] BUG() on inconsistant dcache tree in may_delete

From: Christoph Hellwig
Date: Sat Aug 14 2004 - 09:36:27 EST


This can't happen with a sane filesystem (but is triggered by the buggy
clearcase bin only kernel module), so let's better BUG_ON early.

Adopted from Al's patch in the RH tree.


--- 1.103/fs/namei.c 2004-07-13 16:08:53 +02:00
+++ edited/fs/namei.c 2004-08-14 16:09:16 +02:00
@@ -1094,8 +1094,12 @@
static inline int may_delete(struct inode *dir,struct dentry *victim,int isdir)
{
int error;
- if (!victim->d_inode || victim->d_parent->d_inode != dir)
+
+ if (!victim->d_inode)
return -ENOENT;
+
+ BUG_ON(victim->d_parent->d_inode != dir);
+
error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
if (error)
return error;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/