Skip to content

Commit 2e8af97

Browse files
aaptelsmfrench
authored andcommitted
cifs: rename posix create rsp
little progress on the posix create response. * rename struct to create_posix_rsp to match with the request create_posix context * make struct packed * pass smb info struct for parse_posix_ctxt to fill * use smb info struct as param * update TODO What needs to be done: SMB2_open() has an optional smb info out argument that it will fill. Callers making use of this are: - smb3_query_mf_symlink (need to investigate) - smb2_open_file Callers of smb2_open_file (via server->ops->open) are passing an smbinfo struct but that struct cannot hold POSIX information. All the call stack needs to be changed for a different info type. Maybe pass SMB generic struct like cifs_fattr instead. Signed-off-by: Aurelien Aptel <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 8fe0c2c commit 2e8af97

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

fs/cifs/smb2pdu.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,13 +1951,18 @@ parse_query_id_ctxt(struct create_context *cc, struct smb2_file_all_info *buf)
19511951
}
19521952

19531953
static void
1954-
parse_posix_ctxt(struct create_context *cc, struct smb_posix_info *pposix_inf)
1954+
parse_posix_ctxt(struct create_context *cc, struct smb2_file_all_info *info)
19551955
{
1956-
/* struct smb_posix_info *ppinf = (struct smb_posix_info *)cc; */
1956+
/* struct create_posix_rsp *posix = (struct create_posix_rsp *)cc; */
19571957

1958-
/* TODO: Need to add parsing for the context and return */
1958+
/*
1959+
* TODO: Need to add parsing for the context and return. Can
1960+
* smb2_file_all_info hold POSIX data? Need to change the
1961+
* passed type from SMB2_open.
1962+
*/
19591963
printk_once(KERN_WARNING
19601964
"SMB3 3.11 POSIX response context not completed yet\n");
1965+
19611966
}
19621967

19631968
void
@@ -1995,7 +2000,7 @@ smb2_parse_contexts(struct TCP_Server_Info *server,
19952000
parse_query_id_ctxt(cc, buf);
19962001
else if ((le16_to_cpu(cc->NameLength) == 16)) {
19972002
if (memcmp(name, smb3_create_tag_posix, 16) == 0)
1998-
parse_posix_ctxt(cc, NULL);
2003+
parse_posix_ctxt(cc, buf);
19992004
}
20002005
/* else {
20012006
cifs_dbg(FYI, "Context not matched with len %d\n",

fs/cifs/smb2pdu.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,11 +1604,14 @@ struct smb2_file_id_information {
16041604
extern char smb2_padding[7];
16051605

16061606
/* equivalent of the contents of SMB3.1.1 POSIX open context response */
1607-
struct smb_posix_info {
1607+
struct create_posix_rsp {
16081608
__le32 nlink;
16091609
__le32 reparse_tag;
16101610
__le32 mode;
1611-
kuid_t uid;
1612-
kuid_t gid;
1611+
/*
1612+
* var sized owner SID
1613+
* var sized group SID
1614+
*/
1615+
} __packed;
16131616
};
16141617
#endif /* _SMB2PDU_H */

0 commit comments

Comments
 (0)