Skip to content

Commit

Permalink
ncpfs: document dentry_unhash usage
Browse files Browse the repository at this point in the history
ncpfs returns EBUSY if there are any references to the directory.  The
dentry_unhash call only unhashes the dentry if there are no references.

CC: Petr Vandrovec <petr@vandrovec.name>
CC: linux-kernel@vger.kernel.org
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Sage Weil authored and Al Viro committed May 28, 2011
1 parent 55e5b7e commit 7ce605d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/ncpfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,11 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry)
DPRINTK("ncp_rmdir: removing %s/%s\n",
dentry->d_parent->d_name.name, dentry->d_name.name);

/*
* fail with EBUSY if there are still references to this
* directory.
*/
dentry_unhash(dentry);

error = -EBUSY;
if (!d_unhashed(dentry))
goto out;
Expand Down

0 comments on commit 7ce605d

Please sign in to comment.