cifs: always update the inode cache with the results from a FIND_*
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / cifs / readdir.c
index 0a8224d1c4c5f2df8545f2c84f9e668feba2e0e9..a4217f02fab2860ced9f1bf444662cbf05461a4e 100644 (file)
@@ -86,9 +86,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);
        }