ncpfs: don't bother with EBUSY on removal of busy directories
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 15 Jun 2013 01:53:23 +0000 (05:53 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:16 +0000 (12:57 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ncpfs/dir.c
fs/ncpfs/inode.c

index 0e7f00298213f3249b34f8564609c762d2e765ed..e5d488530580d6ef3e38ec81821ea49f01b8cc41 100644 (file)
@@ -1123,17 +1123,6 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
                old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
                new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
 
-       if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode)) {
-               /*
-                * fail with EBUSY if there are still references to this
-                * directory.
-                */
-               dentry_unhash(new_dentry);
-               error = -EBUSY;
-               if (!d_unhashed(new_dentry))
-                       goto out;
-       }
-
        ncp_age_dentry(server, old_dentry);
        ncp_age_dentry(server, new_dentry);
 
index 26910c8154da1be65c0318eb088d5d69d3e08baf..0765ad12c3827cf9822dacc1875cb64a957c9864 100644 (file)
@@ -891,6 +891,10 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
        if (!server)    /* How this could happen? */
                goto out;
 
+       result = -EPERM;
+       if (IS_DEADDIR(dentry->d_inode))
+               goto out;
+
        /* ageing the dentry to force validation */
        ncp_age_dentry(server, dentry);