These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / ncpfs / dir.c
index 80021c7..03446c5 100644 (file)
@@ -597,7 +597,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
        qname.name = __name;
 
        newdent = d_hash_and_lookup(dentry, &qname);
-       if (unlikely(IS_ERR(newdent)))
+       if (IS_ERR(newdent))
                goto end_advance;
        if (!newdent) {
                newdent = d_alloc(dentry, &qname);
@@ -633,7 +633,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
                                d_rehash(newdent);
                } else {
                        spin_lock(&dentry->d_lock);
-                       NCP_FINFO(inode)->flags &= ~NCPI_DIR_CACHE;
+                       NCP_FINFO(dir)->flags &= ~NCPI_DIR_CACHE;
                        spin_unlock(&dentry->d_lock);
                }
        } else {
@@ -1145,6 +1145,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
                case 0x00:
                        ncp_dbg(1, "renamed %pd -> %pd\n",
                                old_dentry, new_dentry);
+                       ncp_d_prune(old_dentry);
+                       ncp_d_prune(new_dentry);
                        break;
                case 0x9E:
                        error = -ENAMETOOLONG;
@@ -1163,8 +1165,6 @@ out:
 static int ncp_mknod(struct inode * dir, struct dentry *dentry,
                     umode_t mode, dev_t rdev)
 {
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
        if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) {
                ncp_dbg(1, "mode = 0%ho\n", mode);
                return ncp_create_new(dir, dentry, mode, rdev, 0);