cifs: always update the inode cache with the results from a FIND_*
[firefly-linux-kernel-4.4.55.git] / fs / cifs / readdir.c
index 6751e745bbc6a5611081a462c36c5159cbf9ee05..c71032ba5b75dd56f8df4317d98bbcb78ff17c62 100644 (file)
@@ -85,9 +85,12 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
 
        dentry = d_lookup(parent, name);
        if (dentry) {
-               /* FIXME: check for inode number changes? */
-               if (dentry->d_inode != NULL)
+               inode = dentry->d_inode;
+               /* update inode in place if i_ino didn't change */
+               if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
+                       cifs_fattr_to_inode(inode, fattr);
                        return dentry;
+               }
                d_drop(dentry);
                dput(dentry);
        }