Skip to content

Commit 8cb0bc5

Browse files
slowfranklinSteve French
authored andcommitted
fs/smb/client: cifs_prime_dcache() for SMB3 POSIX reparse points
Spares an extra revalidation request Cc: [email protected] Acked-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Ralph Boehme <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 6a832bc commit 8cb0bc5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

fs/smb/client/readdir.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
7171
struct inode *inode;
7272
struct super_block *sb = parent->d_sb;
7373
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
74+
bool posix = cifs_sb_master_tcon(cifs_sb)->posix_extensions;
75+
bool reparse_need_reval = false;
7476
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
7577
int rc;
7678

@@ -85,7 +87,21 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
8587
* this spares us an invalidation.
8688
*/
8789
retry:
88-
if ((fattr->cf_cifsattrs & ATTR_REPARSE) ||
90+
if (posix) {
91+
switch (fattr->cf_mode & S_IFMT) {
92+
case S_IFLNK:
93+
case S_IFBLK:
94+
case S_IFCHR:
95+
reparse_need_reval = true;
96+
break;
97+
default:
98+
break;
99+
}
100+
} else if (fattr->cf_cifsattrs & ATTR_REPARSE) {
101+
reparse_need_reval = true;
102+
}
103+
104+
if (reparse_need_reval ||
89105
(fattr->cf_flags & CIFS_FATTR_NEED_REVAL))
90106
return;
91107

0 commit comments

Comments
 (0)