Skip to content

Commit 7c525dd

Browse files
tobluxsmfrench
authored andcommitted
ksmbd: Replace one-element arrays with flexible-array members
Replace the deprecated one-element arrays with flexible-array members in the structs filesystem_attribute_info and filesystem_device_info. There are no binary differences after this conversion. Link: KSPP#79 Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Gustavo A. R. Silva <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4fdd866 commit 7c525dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5360,7 +5360,7 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
53605360
"NTFS", PATH_MAX, conn->local_nls, 0);
53615361
len = len * 2;
53625362
info->FileSystemNameLen = cpu_to_le32(len);
5363-
sz = sizeof(struct filesystem_attribute_info) - 2 + len;
5363+
sz = sizeof(struct filesystem_attribute_info) + len;
53645364
rsp->OutputBufferLength = cpu_to_le32(sz);
53655365
break;
53665366
}
@@ -5386,7 +5386,7 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
53865386
len = len * 2;
53875387
info->VolumeLabelSize = cpu_to_le32(len);
53885388
info->Reserved = 0;
5389-
sz = sizeof(struct filesystem_vol_info) - 2 + len;
5389+
sz = sizeof(struct filesystem_vol_info) + len;
53905390
rsp->OutputBufferLength = cpu_to_le32(sz);
53915391
break;
53925392
}

fs/smb/server/smb_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct filesystem_attribute_info {
213213
__le32 Attributes;
214214
__le32 MaxPathNameComponentLength;
215215
__le32 FileSystemNameLen;
216-
__le16 FileSystemName[1]; /* do not have to save this - get subset? */
216+
__le16 FileSystemName[]; /* do not have to save this - get subset? */
217217
} __packed;
218218

219219
struct filesystem_device_info {
@@ -226,7 +226,7 @@ struct filesystem_vol_info {
226226
__le32 SerialNumber;
227227
__le32 VolumeLabelSize;
228228
__le16 Reserved;
229-
__le16 VolumeLabel[1];
229+
__le16 VolumeLabel[];
230230
} __packed;
231231

232232
struct filesystem_info {

0 commit comments

Comments
 (0)