Skip to content

Commit

Permalink
cifs: Improve handling of name surrogate reparse points in reparse.c
Browse files Browse the repository at this point in the history
Like previous changes for file inode.c, handle directory name surrogate
reparse points generally also in reparse.c.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Pali Rohár authored and Steve French committed Apr 9, 2025
1 parent 9ce7351 commit 12193b9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions fs/smb/client/reparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,16 +1236,6 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
bool ok;

switch (tag) {
case IO_REPARSE_TAG_INTERNAL:
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
return false;
fallthrough;
case IO_REPARSE_TAG_DFS:
case IO_REPARSE_TAG_DFSR:
case IO_REPARSE_TAG_MOUNT_POINT:
/* See cifs_create_junction_fattr() */
fattr->cf_mode = S_IFDIR | 0711;
break;
case IO_REPARSE_TAG_LX_SYMLINK:
case IO_REPARSE_TAG_LX_FIFO:
case IO_REPARSE_TAG_AF_UNIX:
Expand All @@ -1265,7 +1255,14 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
fattr->cf_mode |= S_IFLNK;
break;
default:
return false;
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
return false;
if (!IS_REPARSE_TAG_NAME_SURROGATE(tag) &&
tag != IO_REPARSE_TAG_INTERNAL)
return false;
/* See cifs_create_junction_fattr() */
fattr->cf_mode = S_IFDIR | 0711;
break;
}

fattr->cf_dtype = S_DT(fattr->cf_mode);
Expand Down

0 comments on commit 12193b9

Please sign in to comment.