Skip to content

Commit 4236ac9

Browse files
paliSteve French
authored andcommitted
cifs: Fix querying and creating MF symlinks over SMB1
Old SMB1 servers without CAP_NT_SMBS do not support CIFS_open() function and instead SMBLegacyOpen() needs to be used. This logic is already handled in cifs_open_file() function, which is server->ops->open callback function. So for querying and creating MF symlinks use open callback function instead of CIFS_open() function directly. This change fixes querying and creating new MF symlinks on Windows 98. Currently cifs_query_mf_symlink() is not able to detect MF symlink and cifs_create_mf_symlink() is failing with EIO error. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 6aa9f1c commit 4236ac9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/smb/client/link.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
258258
struct cifs_open_parms oparms;
259259
struct cifs_io_parms io_parms = {0};
260260
int buf_type = CIFS_NO_BUFFER;
261-
FILE_ALL_INFO file_info;
261+
struct cifs_open_info_data query_data;
262262

263263
oparms = (struct cifs_open_parms) {
264264
.tcon = tcon,
@@ -270,11 +270,11 @@ cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
270270
.fid = &fid,
271271
};
272272

273-
rc = CIFS_open(xid, &oparms, &oplock, &file_info);
273+
rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, &query_data);
274274
if (rc)
275275
return rc;
276276

277-
if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
277+
if (query_data.fi.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) {
278278
rc = -ENOENT;
279279
/* it's not a symlink */
280280
goto out;
@@ -313,7 +313,7 @@ cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
313313
.fid = &fid,
314314
};
315315

316-
rc = CIFS_open(xid, &oparms, &oplock, NULL);
316+
rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, NULL);
317317
if (rc)
318318
return rc;
319319

0 commit comments

Comments
 (0)