Commit 5db90d87 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

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

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.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent daf178a7
...@@ -1094,8 +1094,12 @@ static inline int check_sticky(struct inode *dir, struct inode *inode) ...@@ -1094,8 +1094,12 @@ static inline int check_sticky(struct inode *dir, struct inode *inode)
static inline int may_delete(struct inode *dir,struct dentry *victim,int isdir) static inline int may_delete(struct inode *dir,struct dentry *victim,int isdir)
{ {
int error; int error;
if (!victim->d_inode || victim->d_parent->d_inode != dir)
if (!victim->d_inode)
return -ENOENT; return -ENOENT;
BUG_ON(victim->d_parent->d_inode != dir);
error = permission(dir,MAY_WRITE | MAY_EXEC, NULL); error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
if (error) if (error)
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment