Skip to content

Commit 07c8427

Browse files
palijfvogel
authored andcommitted
cifs: Remove symlink member from cifs_open_info_data union
[ 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 <pali@kernel.org> Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com> 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 <sashal@kernel.org> (cherry picked from commit c011482fb5fa867350aaad506d1455b34c1c2e42) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent cb39ac9 commit 07c8427

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
@@ -209,10 +209,7 @@ struct cifs_cred {
209209

210210
struct cifs_open_info_data {
211211
bool adjust_tz;
212-
union {
213-
bool reparse_point;
214-
bool symlink;
215-
};
212+
bool reparse_point;
216213
struct {
217214
/* ioctl response buffer */
218215
struct {

fs/smb/client/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ cifs_get_file_info(struct file *filp)
968968
/* TODO: add support to query reparse tag */
969969
data.adjust_tz = false;
970970
if (data.symlink_target) {
971-
data.symlink = true;
971+
data.reparse_point = true;
972972
data.reparse.tag = IO_REPARSE_TAG_SYMLINK;
973973
}
974974
path = build_path_from_dentry(dentry, page);

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)