diff options
| -rw-r--r-- | fs/cifs/readdir.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 6002fdc920ae..cdd6ff48246b 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
| @@ -78,6 +78,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, | |||
| 78 | struct dentry *dentry, *alias; | 78 | struct dentry *dentry, *alias; |
| 79 | struct inode *inode; | 79 | struct inode *inode; |
| 80 | struct super_block *sb = parent->d_inode->i_sb; | 80 | struct super_block *sb = parent->d_inode->i_sb; |
| 81 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | ||
| 81 | 82 | ||
| 82 | cFYI(1, "%s: for %s", __func__, name->name); | 83 | cFYI(1, "%s: for %s", __func__, name->name); |
| 83 | 84 | ||
| @@ -91,10 +92,20 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, | |||
| 91 | int err; | 92 | int err; |
| 92 | 93 | ||
| 93 | inode = dentry->d_inode; | 94 | inode = dentry->d_inode; |
| 94 | /* update inode in place if i_ino didn't change */ | 95 | if (inode) { |
| 95 | if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { | 96 | /* |
| 96 | cifs_fattr_to_inode(inode, fattr); | 97 | * If we're generating inode numbers, then we don't |
| 97 | goto out; | 98 | * want to clobber the existing one with the one that |
| 99 | * the readdir code created. | ||
| 100 | */ | ||
| 101 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) | ||
| 102 | fattr->cf_uniqueid = CIFS_I(inode)->uniqueid; | ||
| 103 | |||
| 104 | /* update inode in place if i_ino didn't change */ | ||
| 105 | if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { | ||
| 106 | cifs_fattr_to_inode(inode, fattr); | ||
| 107 | goto out; | ||
| 108 | } | ||
| 98 | } | 109 | } |
| 99 | err = d_invalidate(dentry); | 110 | err = d_invalidate(dentry); |
| 100 | dput(dentry); | 111 | dput(dentry); |
