]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: fix lookup on deleted directory
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 2 Jul 2008 19:30:15 +0000 (21:30 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Aug 2008 16:03:23 +0000 (09:03 -0700)
commitefd5285ead8cccc76e3a978ffdeadaf86bf7aa17
tree1e938da51433cf1f2fb4165d54bdcba67f4bb871
parent5c975097aed78c18bb8b0b122968a9c265e7e28b
vfs: fix lookup on deleted directory

commit d70b67c8bc72ee23b55381bd6a884f4796692f77 upstream

Lookup can install a child dentry for a deleted directory.  This keeps
the directory dentry alive, and the inode pinned in the cache and on
disk, even after all external references have gone away.

This isn't a big problem normally, since memory pressure or umount
will clear out the directory dentry and its children, releasing the
inode.  But for UBIFS this causes problems because its orphan area can
overflow.

Fix this by returning ENOENT for all lookups on a S_DEAD directory
before creating a child dentry.

Thanks to Zoltan Sogor for noticing this while testing UBIFS, and
Artem for the excellent analysis of the problem and testing.

Reported-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/namei.c