]> Git Repo - linux.git/commitdiff
fs/smb/client: cifs_prime_dcache() for SMB3 POSIX reparse points
authorRalph Boehme <[email protected]>
Mon, 25 Nov 2024 15:19:56 +0000 (16:19 +0100)
committerSteve French <[email protected]>
Wed, 4 Dec 2024 23:39:51 +0000 (17:39 -0600)
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]>
fs/smb/client/readdir.c

index f878bcdbd319836ba071cce22a74a0efb67bae95..b906bf78af1ecca81101b49f1c1939d2bbe513b1 100644 (file)
@@ -71,6 +71,8 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
        struct inode *inode;
        struct super_block *sb = parent->d_sb;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+       bool posix = cifs_sb_master_tcon(cifs_sb)->posix_extensions;
+       bool reparse_need_reval = false;
        DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
        int rc;
 
@@ -85,7 +87,21 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
                 * this spares us an invalidation.
                 */
 retry:
-               if ((fattr->cf_cifsattrs & ATTR_REPARSE) ||
+               if (posix) {
+                       switch (fattr->cf_mode & S_IFMT) {
+                       case S_IFLNK:
+                       case S_IFBLK:
+                       case S_IFCHR:
+                               reparse_need_reval = true;
+                               break;
+                       default:
+                               break;
+                       }
+               } else if (fattr->cf_cifsattrs & ATTR_REPARSE) {
+                       reparse_need_reval = true;
+               }
+
+               if (reparse_need_reval ||
                    (fattr->cf_flags & CIFS_FATTR_NEED_REVAL))
                        return;
 
This page took 0.050017 seconds and 4 git commands to generate.