]> git.baikalelectronics.ru Git - kernel.git/commit
[patch] vfs: fix lookup on deleted directory
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 2 Jul 2008 19:30:15 +0000 (21:30 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 27 Jul 2008 00:53:05 +0000 (20:53 -0400)
commitf5901b8ed7a8163a1700c20b9a1d4dafd27e6318
treec15055c81f21b7863318e1e6f8a9620afaeb3327
parent0b5e6319c5635a5d0c8e914c6682c9fa0e14071d
[patch] vfs: fix lookup on deleted directory

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>
fs/namei.c