]> git.baikalelectronics.ru Git - kernel.git/commit
restore pinning the victim dentry in vfs_rmdir()/vfs_rename_dir()
authorAl Viro <viro@ZenIV.linux.org.uk>
Wed, 14 Sep 2011 17:55:41 +0000 (18:55 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Sep 2011 18:31:55 +0000 (11:31 -0700)
commit271a8f69695efec4fc6086ad86573f9adbf352e7
treeadd2cc75116bf7588434f212bb8dd52d32b320d5
parent47abdf718ed10a257b37edf2aaeb617cfd7705d0
restore pinning the victim dentry in vfs_rmdir()/vfs_rename_dir()

We used to get the victim pinned by dentry_unhash() prior to commit
902bc6924ab9 ("vfs: remove dget() from dentry_unhash()") and ->rmdir()
and ->rename() instances relied on that; most of them don't care, but
ones that used d_delete() themselves do.  As the result, we are getting
rmdir() oopses on NFS now.

Just grab the reference before locking the victim and drop it explicitly
after unlocking, same as vfs_rename_other() does.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Simon Kirby <sim@hostway.ca>
Cc: stable@kernel.org (3.0.x)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c