All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] BUG() on inconsistant dcache tree in may_delete
@ 2004-08-14 14:32 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-08-14 14:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-14 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-14 14:32 [PATCH] BUG() on inconsistant dcache tree in may_delete Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.