Skip to content

Commit 9f63233

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: add default data stream name in FILE_STREAM_INFORMATION
Windows client expect to get default stream name(::DATA) in FILE_STREAM_INFORMATION response even if there is no stream data in file. This patch fix update failure when writing ppt or doc files. Signed-off-by: Namjae Jeon <[email protected]> Reviewed-By: Tom Talpey <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent e44fd50 commit 9f63233

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fs/ksmbd/smb2pdu.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4428,17 +4428,15 @@ static void get_file_stream_info(struct ksmbd_work *work,
44284428
file_info->NextEntryOffset = cpu_to_le32(next);
44294429
}
44304430

4431-
if (nbytes) {
4431+
if (!S_ISDIR(stat.mode)) {
44324432
file_info = (struct smb2_file_stream_info *)
44334433
&rsp->Buffer[nbytes];
44344434
streamlen = smbConvertToUTF16((__le16 *)file_info->StreamName,
44354435
"::$DATA", 7, conn->local_nls, 0);
44364436
streamlen *= 2;
44374437
file_info->StreamNameLength = cpu_to_le32(streamlen);
4438-
file_info->StreamSize = S_ISDIR(stat.mode) ? 0 :
4439-
cpu_to_le64(stat.size);
4440-
file_info->StreamAllocationSize = S_ISDIR(stat.mode) ? 0 :
4441-
cpu_to_le64(stat.size);
4438+
file_info->StreamSize = 0;
4439+
file_info->StreamAllocationSize = 0;
44424440
nbytes += sizeof(struct smb2_file_stream_info) + streamlen;
44434441
}
44444442

0 commit comments

Comments
 (0)