Skip to content

Commit 12193b9

Browse files
paliSteve French
authored andcommitted
cifs: Improve handling of name surrogate reparse points in reparse.c
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>
1 parent 9ce7351 commit 12193b9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

fs/smb/client/reparse.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,16 +1236,6 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
12361236
bool ok;
12371237

12381238
switch (tag) {
1239-
case IO_REPARSE_TAG_INTERNAL:
1240-
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
1241-
return false;
1242-
fallthrough;
1243-
case IO_REPARSE_TAG_DFS:
1244-
case IO_REPARSE_TAG_DFSR:
1245-
case IO_REPARSE_TAG_MOUNT_POINT:
1246-
/* See cifs_create_junction_fattr() */
1247-
fattr->cf_mode = S_IFDIR | 0711;
1248-
break;
12491239
case IO_REPARSE_TAG_LX_SYMLINK:
12501240
case IO_REPARSE_TAG_LX_FIFO:
12511241
case IO_REPARSE_TAG_AF_UNIX:
@@ -1265,7 +1255,14 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
12651255
fattr->cf_mode |= S_IFLNK;
12661256
break;
12671257
default:
1268-
return false;
1258+
if (!(fattr->cf_cifsattrs & ATTR_DIRECTORY))
1259+
return false;
1260+
if (!IS_REPARSE_TAG_NAME_SURROGATE(tag) &&
1261+
tag != IO_REPARSE_TAG_INTERNAL)
1262+
return false;
1263+
/* See cifs_create_junction_fattr() */
1264+
fattr->cf_mode = S_IFDIR | 0711;
1265+
break;
12691266
}
12701267

12711268
fattr->cf_dtype = S_DT(fattr->cf_mode);

0 commit comments

Comments
 (0)