Skip to content

Commit 29cf282

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: fix file info setting in cifs_query_path_info()
We missed to set file info when CIFSSMBQPathInfo() returned 0, thus leaving cifs_open_info_data::fi unset. Fix this by setting cifs_open_info_data::fi when either CIFSSMBQPathInfo() or SMBQueryInformation() succeed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216881 Fixes: 76894f3 ("cifs: improve symlink handling for smb2+") Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent b7bfaa7 commit 29cf282

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fs/cifs/smb1ops.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,17 +562,20 @@ static int cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
562562
if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) {
563563
rc = SMBQueryInformation(xid, tcon, full_path, &fi, cifs_sb->local_nls,
564564
cifs_remap(cifs_sb));
565-
if (!rc)
566-
move_cifs_info_to_smb2(&data->fi, &fi);
567565
*adjustTZ = true;
568566
}
569567

570-
if (!rc && (le32_to_cpu(fi.Attributes) & ATTR_REPARSE)) {
568+
if (!rc) {
571569
int tmprc;
572570
int oplock = 0;
573571
struct cifs_fid fid;
574572
struct cifs_open_parms oparms;
575573

574+
move_cifs_info_to_smb2(&data->fi, &fi);
575+
576+
if (!(le32_to_cpu(fi.Attributes) & ATTR_REPARSE))
577+
return 0;
578+
576579
oparms.tcon = tcon;
577580
oparms.cifs_sb = cifs_sb;
578581
oparms.desired_access = FILE_READ_ATTRIBUTES;

0 commit comments

Comments
 (0)