Skip to content

Commit f8e3261

Browse files
palismb49
authored andcommitted
cifs: Remove symlink member from cifs_open_info_data union
BugLink: https://bugs.launchpad.net/bugs/2117533 [ Upstream commit 65c4976 ] Member 'symlink' is part of the union in struct cifs_open_info_data. Its value is assigned on few places, but is always read through another union member 'reparse_point'. So to make code more readable, always use only 'reparse_point' member and drop whole union structure. No function change. Signed-off-by: Pali Rohár <[email protected]> Acked-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Steve French <[email protected]> Stable-dep-of: 9df2380 ("smb311: failure to open files of length 1040 when mounting with SMB3.1.1 POSIX extensions") Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 6a7d28f commit f8e3261

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

fs/smb/client/cifsglob.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ struct cifs_cred {
198198

199199
struct cifs_open_info_data {
200200
bool adjust_tz;
201-
union {
202-
bool reparse_point;
203-
bool symlink;
204-
};
201+
bool reparse_point;
205202
struct {
206203
/* ioctl response buffer */
207204
struct {

fs/smb/client/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ cifs_get_file_info(struct file *filp)
830830
/* TODO: add support to query reparse tag */
831831
data.adjust_tz = false;
832832
if (data.symlink_target) {
833-
data.symlink = true;
833+
data.reparse_point = true;
834834
data.reparse.tag = IO_REPARSE_TAG_SYMLINK;
835835
}
836836
cifs_open_info_to_fattr(&fattr, &data, inode->i_sb);

fs/smb/client/smb1ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int cifs_query_path_info(const unsigned int xid,
551551
int rc;
552552
FILE_ALL_INFO fi = {};
553553

554-
data->symlink = false;
554+
data->reparse_point = false;
555555
data->adjust_tz = false;
556556

557557
/* could do find first instead but this returns more info */
@@ -592,7 +592,7 @@ static int cifs_query_path_info(const unsigned int xid,
592592
/* Need to check if this is a symbolic link or not */
593593
tmprc = CIFS_open(xid, &oparms, &oplock, NULL);
594594
if (tmprc == -EOPNOTSUPP)
595-
data->symlink = true;
595+
data->reparse_point = true;
596596
else if (tmprc == 0)
597597
CIFSSMBClose(xid, tcon, fid.netfid);
598598
}

0 commit comments

Comments
 (0)