Skip to content

Commit

Permalink
fs/smb/client: cifs_prime_dcache() for SMB3 POSIX reparse points
Browse files Browse the repository at this point in the history
commit 8cb0bc5436351de8a11eef13b7367d64cc0d6c68 upstream.

Spares an extra revalidation request

Cc: stable@vger.kernel.org
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
slowfranklin authored and opsiff committed Dec 15, 2024
1 parent 865376a commit 2f59f2b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion fs/smb/client/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 2f59f2b

Please sign in to comment.