aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 8eaf20a80649..c295338e0a98 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -69,7 +69,8 @@ static inline void dump_cifs_file_struct(struct file *file, char *label)
69 * Attempt to preload the dcache with the results from the FIND_FIRST/NEXT 69 * Attempt to preload the dcache with the results from the FIND_FIRST/NEXT
70 * 70 *
71 * Find the dentry that matches "name". If there isn't one, create one. If it's 71 * Find the dentry that matches "name". If there isn't one, create one. If it's
72 * a negative dentry or the uniqueid changed, then drop it and recreate it. 72 * a negative dentry or the uniqueid or filetype(mode) changed,
73 * then drop it and recreate it.
73 */ 74 */
74static void 75static void
75cifs_prime_dcache(struct dentry *parent, struct qstr *name, 76cifs_prime_dcache(struct dentry *parent, struct qstr *name,
@@ -97,8 +98,11 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
97 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) 98 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
98 fattr->cf_uniqueid = CIFS_I(inode)->uniqueid; 99 fattr->cf_uniqueid = CIFS_I(inode)->uniqueid;
99 100
100 /* update inode in place if i_ino didn't change */ 101 /* update inode in place
101 if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { 102 * if both i_ino and i_mode didn't change */
103 if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid &&
104 (inode->i_mode & S_IFMT) ==
105 (fattr->cf_mode & S_IFMT)) {
102 cifs_fattr_to_inode(inode, fattr); 106 cifs_fattr_to_inode(inode, fattr);
103 goto out; 107 goto out;
104 } 108 }