Skip to content

Commit 32ba030

Browse files
paliSteve French
authored andcommitted
cifs: Simplify reparse point check in cifs_query_path_info() function
For checking if path is reparse point and setting data->reparse_point member, it is enough to check if ATTR_REPARSE is present. It is not required to call CIFS_open() without OPEN_REPARSE_POINT and checking for -EOPNOTSUPP error code. 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>
1 parent 65c4976 commit 32ba030

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

fs/smb/client/smb1ops.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -569,32 +569,8 @@ static int cifs_query_path_info(const unsigned int xid,
569569
}
570570

571571
if (!rc) {
572-
int tmprc;
573-
int oplock = 0;
574-
struct cifs_fid fid;
575-
struct cifs_open_parms oparms;
576-
577572
move_cifs_info_to_smb2(&data->fi, &fi);
578-
579-
if (!(le32_to_cpu(fi.Attributes) & ATTR_REPARSE))
580-
return 0;
581-
582-
oparms = (struct cifs_open_parms) {
583-
.tcon = tcon,
584-
.cifs_sb = cifs_sb,
585-
.desired_access = FILE_READ_ATTRIBUTES,
586-
.create_options = cifs_create_options(cifs_sb, 0),
587-
.disposition = FILE_OPEN,
588-
.path = full_path,
589-
.fid = &fid,
590-
};
591-
592-
/* Need to check if this is a symbolic link or not */
593-
tmprc = CIFS_open(xid, &oparms, &oplock, NULL);
594-
if (tmprc == -EOPNOTSUPP)
595-
data->reparse_point = true;
596-
else if (tmprc == 0)
597-
CIFSSMBClose(xid, tcon, fid.netfid);
573+
data->reparse_point = le32_to_cpu(fi.Attributes) & ATTR_REPARSE;
598574
}
599575

600576
return rc;

0 commit comments

Comments
 (0)