mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag '5.16-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs updates from Steve French: - reconnect fix for stable - minor mount option fix - debugging improvement for (TCP) connection issues - refactoring of common code to help ksmbd * tag '5.16-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: add dynamic trace points for socket connection cifs: Move SMB2_Create definitions to the shared area cifs: Move more definitions into the shared area cifs: move NEGOTIATE_PROTOCOL definitions out into the common area cifs: Create a new shared file holding smb2 pdu definitions cifs: add mount parameter tcpnodelay cifs: To match file servers, make sure the server hostname matches
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include <linux/key-type.h>
|
||||
#include "cifs_spnego.h"
|
||||
#include "fscache.h"
|
||||
#include "smb2pdu.h"
|
||||
#ifdef CONFIG_CIFS_DFS_UPCALL
|
||||
#include "dfs_cache.h"
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <crypto/internal/hash.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <uapi/linux/cifs/cifs_mount.h>
|
||||
#include "../smbfs_common/smb2pdu.h"
|
||||
#include "smb2pdu.h"
|
||||
|
||||
#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
|
||||
@@ -776,7 +777,7 @@ revert_current_mid(struct TCP_Server_Info *server, const unsigned int val)
|
||||
|
||||
static inline void
|
||||
revert_current_mid_from_hdr(struct TCP_Server_Info *server,
|
||||
const struct smb2_sync_hdr *shdr)
|
||||
const struct smb2_hdr *shdr)
|
||||
{
|
||||
unsigned int num = le16_to_cpu(shdr->CreditCharge);
|
||||
|
||||
|
||||
@@ -677,7 +677,7 @@ dequeue_mid(struct mid_q_entry *mid, bool malformed)
|
||||
static unsigned int
|
||||
smb2_get_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buffer;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buffer;
|
||||
|
||||
/*
|
||||
* SMB1 does not use credits.
|
||||
@@ -794,7 +794,6 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server)
|
||||
*/
|
||||
}
|
||||
|
||||
kfree(server->hostname);
|
||||
kfree(server);
|
||||
|
||||
length = atomic_dec_return(&tcpSesAllocCount);
|
||||
@@ -878,7 +877,7 @@ cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid)
|
||||
static void
|
||||
smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buffer;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buffer;
|
||||
int scredits, in_flight;
|
||||
|
||||
/*
|
||||
@@ -1235,6 +1234,9 @@ static int match_server(struct TCP_Server_Info *server, struct smb3_fs_context *
|
||||
if (!net_eq(cifs_net_ns(server), current->nsproxy->net_ns))
|
||||
return 0;
|
||||
|
||||
if (strcasecmp(server->hostname, ctx->server_hostname))
|
||||
return 0;
|
||||
|
||||
if (!match_address(server, addr,
|
||||
(struct sockaddr *)&ctx->srcaddr))
|
||||
return 0;
|
||||
@@ -1336,6 +1338,7 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)
|
||||
kfree(server->session_key.response);
|
||||
server->session_key.response = NULL;
|
||||
server->session_key.len = 0;
|
||||
kfree(server->hostname);
|
||||
|
||||
task = xchg(&server->tsk, NULL);
|
||||
if (task)
|
||||
@@ -1361,14 +1364,15 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx)
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
tcp_ses->hostname = kstrdup(ctx->server_hostname, GFP_KERNEL);
|
||||
if (!tcp_ses->hostname) {
|
||||
rc = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
tcp_ses->ops = ctx->ops;
|
||||
tcp_ses->vals = ctx->vals;
|
||||
cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns));
|
||||
tcp_ses->hostname = extract_hostname(ctx->UNC);
|
||||
if (IS_ERR(tcp_ses->hostname)) {
|
||||
rc = PTR_ERR(tcp_ses->hostname);
|
||||
goto out_err_crypto_release;
|
||||
}
|
||||
|
||||
tcp_ses->conn_id = atomic_inc_return(&tcpSesNextId);
|
||||
tcp_ses->noblockcnt = ctx->rootfs;
|
||||
@@ -1497,8 +1501,7 @@ out_err_crypto_release:
|
||||
|
||||
out_err:
|
||||
if (tcp_ses) {
|
||||
if (!IS_ERR(tcp_ses->hostname))
|
||||
kfree(tcp_ses->hostname);
|
||||
kfree(tcp_ses->hostname);
|
||||
if (tcp_ses->ssocket)
|
||||
sock_release(tcp_ses->ssocket);
|
||||
kfree(tcp_ses);
|
||||
@@ -2646,11 +2649,12 @@ generic_ip_connect(struct TCP_Server_Info *server)
|
||||
rc = 0;
|
||||
if (rc < 0) {
|
||||
cifs_dbg(FYI, "Error %d connecting to server\n", rc);
|
||||
trace_smb3_connect_err(server->hostname, server->conn_id, &server->dstaddr, rc);
|
||||
sock_release(socket);
|
||||
server->ssocket = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
trace_smb3_connect_done(server->hostname, server->conn_id, &server->dstaddr);
|
||||
if (sport == htons(RFC1001_PORT))
|
||||
rc = ip_rfc1001_connect(server);
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
|
||||
fsparam_flag("nosharesock", Opt_nosharesock),
|
||||
fsparam_flag_no("persistenthandles", Opt_persistent),
|
||||
fsparam_flag_no("resilienthandles", Opt_resilient),
|
||||
fsparam_flag_no("tcpnodelay", Opt_tcp_nodelay),
|
||||
fsparam_flag("domainauto", Opt_domainauto),
|
||||
fsparam_flag("rdma", Opt_rdma),
|
||||
fsparam_flag("modesid", Opt_modesid),
|
||||
@@ -318,6 +319,7 @@ smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx
|
||||
DUP_CTX_STR(mount_options);
|
||||
DUP_CTX_STR(username);
|
||||
DUP_CTX_STR(password);
|
||||
DUP_CTX_STR(server_hostname);
|
||||
DUP_CTX_STR(UNC);
|
||||
DUP_CTX_STR(source);
|
||||
DUP_CTX_STR(domainname);
|
||||
@@ -456,6 +458,11 @@ smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx)
|
||||
if (!pos)
|
||||
return -EINVAL;
|
||||
|
||||
/* record the server hostname */
|
||||
ctx->server_hostname = kstrndup(devname + 2, pos - devname - 2, GFP_KERNEL);
|
||||
if (!ctx->server_hostname)
|
||||
return -ENOMEM;
|
||||
|
||||
/* skip past delimiter */
|
||||
++pos;
|
||||
|
||||
@@ -1383,6 +1390,13 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Opt_tcp_nodelay:
|
||||
/* tcp nodelay should not usually be needed since we CORK/UNCORK the socket */
|
||||
if (result.negated)
|
||||
ctx->sockopt_tcp_nodelay = false;
|
||||
else
|
||||
ctx->sockopt_tcp_nodelay = true;
|
||||
break;
|
||||
case Opt_domainauto:
|
||||
ctx->domainauto = true;
|
||||
break;
|
||||
@@ -1496,6 +1510,8 @@ smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx)
|
||||
ctx->username = NULL;
|
||||
kfree_sensitive(ctx->password);
|
||||
ctx->password = NULL;
|
||||
kfree(ctx->server_hostname);
|
||||
ctx->server_hostname = NULL;
|
||||
kfree(ctx->UNC);
|
||||
ctx->UNC = NULL;
|
||||
kfree(ctx->source);
|
||||
|
||||
@@ -98,6 +98,7 @@ enum cifs_param {
|
||||
Opt_nosharesock,
|
||||
Opt_persistent,
|
||||
Opt_resilient,
|
||||
Opt_tcp_nodelay,
|
||||
Opt_domainauto,
|
||||
Opt_rdma,
|
||||
Opt_modesid,
|
||||
@@ -166,6 +167,7 @@ struct smb3_fs_context {
|
||||
char *password;
|
||||
char *domainname;
|
||||
char *source;
|
||||
char *server_hostname;
|
||||
char *UNC;
|
||||
char *nodename;
|
||||
char *iocharset; /* local code page for mapping to and from Unicode */
|
||||
|
||||
@@ -152,7 +152,7 @@ cifs_buf_get(void)
|
||||
* SMB2 header is bigger than CIFS one - no problems to clean some
|
||||
* more bytes for CIFS.
|
||||
*/
|
||||
size_t buf_size = sizeof(struct smb2_sync_hdr);
|
||||
size_t buf_size = sizeof(struct smb2_hdr);
|
||||
|
||||
/*
|
||||
* We could use negotiated size instead of max_msgsize -
|
||||
|
||||
@@ -2439,14 +2439,16 @@ smb2_print_status(__le32 status)
|
||||
int
|
||||
map_smb2_to_linux_error(char *buf, bool log_err)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
unsigned int i;
|
||||
int rc = -EIO;
|
||||
__le32 smb2err = shdr->Status;
|
||||
|
||||
if (smb2err == 0) {
|
||||
trace_smb3_cmd_done(shdr->TreeId, shdr->SessionId,
|
||||
le16_to_cpu(shdr->Command), le64_to_cpu(shdr->MessageId));
|
||||
trace_smb3_cmd_done(le32_to_cpu(shdr->Id.SyncId.TreeId),
|
||||
le64_to_cpu(shdr->SessionId),
|
||||
le16_to_cpu(shdr->Command),
|
||||
le64_to_cpu(shdr->MessageId));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2470,8 +2472,10 @@ map_smb2_to_linux_error(char *buf, bool log_err)
|
||||
cifs_dbg(FYI, "Mapping SMB2 status code 0x%08x to POSIX err %d\n",
|
||||
__le32_to_cpu(smb2err), rc);
|
||||
|
||||
trace_smb3_cmd_err(shdr->TreeId, shdr->SessionId,
|
||||
le16_to_cpu(shdr->Command),
|
||||
le64_to_cpu(shdr->MessageId), le32_to_cpu(smb2err), rc);
|
||||
trace_smb3_cmd_err(le32_to_cpu(shdr->Id.SyncId.TreeId),
|
||||
le64_to_cpu(shdr->SessionId),
|
||||
le16_to_cpu(shdr->Command),
|
||||
le64_to_cpu(shdr->MessageId),
|
||||
le32_to_cpu(smb2err), rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*
|
||||
*/
|
||||
#include <linux/ctype.h>
|
||||
#include "smb2pdu.h"
|
||||
#include "cifsglob.h"
|
||||
#include "cifsproto.h"
|
||||
#include "smb2proto.h"
|
||||
@@ -19,7 +18,7 @@
|
||||
#include "nterr.h"
|
||||
|
||||
static int
|
||||
check_smb2_hdr(struct smb2_sync_hdr *shdr, __u64 mid)
|
||||
check_smb2_hdr(struct smb2_hdr *shdr, __u64 mid)
|
||||
{
|
||||
__u64 wire_mid = le64_to_cpu(shdr->MessageId);
|
||||
|
||||
@@ -81,9 +80,9 @@ static const __le16 smb2_rsp_struct_sizes[NUMBER_OF_SMB2_COMMANDS] = {
|
||||
/* SMB2_OPLOCK_BREAK */ cpu_to_le16(24)
|
||||
};
|
||||
|
||||
#define SMB311_NEGPROT_BASE_SIZE (sizeof(struct smb2_sync_hdr) + sizeof(struct smb2_negotiate_rsp))
|
||||
#define SMB311_NEGPROT_BASE_SIZE (sizeof(struct smb2_hdr) + sizeof(struct smb2_negotiate_rsp))
|
||||
|
||||
static __u32 get_neg_ctxt_len(struct smb2_sync_hdr *hdr, __u32 len,
|
||||
static __u32 get_neg_ctxt_len(struct smb2_hdr *hdr, __u32 len,
|
||||
__u32 non_ctxlen)
|
||||
{
|
||||
__u16 neg_count;
|
||||
@@ -135,13 +134,13 @@ static __u32 get_neg_ctxt_len(struct smb2_sync_hdr *hdr, __u32 len,
|
||||
int
|
||||
smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_sync_pdu *pdu = (struct smb2_sync_pdu *)shdr;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
struct smb2_pdu *pdu = (struct smb2_pdu *)shdr;
|
||||
__u64 mid;
|
||||
__u32 clc_len; /* calculated length */
|
||||
int command;
|
||||
int pdu_size = sizeof(struct smb2_sync_pdu);
|
||||
int hdr_size = sizeof(struct smb2_sync_hdr);
|
||||
int pdu_size = sizeof(struct smb2_pdu);
|
||||
int hdr_size = sizeof(struct smb2_hdr);
|
||||
|
||||
/*
|
||||
* Add function to do table lookup of StructureSize by command
|
||||
@@ -155,7 +154,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr)
|
||||
/* decrypt frame now that it is completely read in */
|
||||
spin_lock(&cifs_tcp_ses_lock);
|
||||
list_for_each_entry(ses, &srvr->smb_ses_list, smb_ses_list) {
|
||||
if (ses->Suid == thdr->SessionId)
|
||||
if (ses->Suid == le64_to_cpu(thdr->SessionId))
|
||||
break;
|
||||
}
|
||||
spin_unlock(&cifs_tcp_ses_lock);
|
||||
@@ -296,7 +295,7 @@ static const bool has_smb2_data_area[NUMBER_OF_SMB2_COMMANDS] = {
|
||||
* area and the offset to it (from the beginning of the smb are also returned.
|
||||
*/
|
||||
char *
|
||||
smb2_get_data_area_len(int *off, int *len, struct smb2_sync_hdr *shdr)
|
||||
smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *shdr)
|
||||
{
|
||||
*off = 0;
|
||||
*len = 0;
|
||||
@@ -401,8 +400,8 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_sync_hdr *shdr)
|
||||
unsigned int
|
||||
smb2_calc_size(void *buf, struct TCP_Server_Info *srvr)
|
||||
{
|
||||
struct smb2_sync_pdu *pdu = (struct smb2_sync_pdu *)buf;
|
||||
struct smb2_sync_hdr *shdr = &pdu->sync_hdr;
|
||||
struct smb2_pdu *pdu = (struct smb2_pdu *)buf;
|
||||
struct smb2_hdr *shdr = &pdu->hdr;
|
||||
int offset; /* the offset from the beginning of SMB to data area */
|
||||
int data_length; /* the length of the variable length data area */
|
||||
/* Structure Size has already been checked to make sure it is 64 */
|
||||
@@ -669,7 +668,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
|
||||
|
||||
cifs_dbg(FYI, "Checking for oplock break\n");
|
||||
|
||||
if (rsp->sync_hdr.Command != SMB2_OPLOCK_BREAK)
|
||||
if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
|
||||
return false;
|
||||
|
||||
if (rsp->StructureSize !=
|
||||
@@ -816,25 +815,25 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid,
|
||||
int
|
||||
smb2_handle_cancelled_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server)
|
||||
{
|
||||
struct smb2_sync_hdr *sync_hdr = mid->resp_buf;
|
||||
struct smb2_hdr *hdr = mid->resp_buf;
|
||||
struct smb2_create_rsp *rsp = mid->resp_buf;
|
||||
struct cifs_tcon *tcon;
|
||||
int rc;
|
||||
|
||||
if ((mid->optype & CIFS_CP_CREATE_CLOSE_OP) || sync_hdr->Command != SMB2_CREATE ||
|
||||
sync_hdr->Status != STATUS_SUCCESS)
|
||||
if ((mid->optype & CIFS_CP_CREATE_CLOSE_OP) || hdr->Command != SMB2_CREATE ||
|
||||
hdr->Status != STATUS_SUCCESS)
|
||||
return 0;
|
||||
|
||||
tcon = smb2_find_smb_tcon(server, sync_hdr->SessionId,
|
||||
sync_hdr->TreeId);
|
||||
tcon = smb2_find_smb_tcon(server, le64_to_cpu(hdr->SessionId),
|
||||
le32_to_cpu(hdr->Id.SyncId.TreeId));
|
||||
if (!tcon)
|
||||
return -ENOENT;
|
||||
|
||||
rc = __smb2_handle_cancelled_cmd(tcon,
|
||||
le16_to_cpu(sync_hdr->Command),
|
||||
le64_to_cpu(sync_hdr->MessageId),
|
||||
rsp->PersistentFileId,
|
||||
rsp->VolatileFileId);
|
||||
le16_to_cpu(hdr->Command),
|
||||
le64_to_cpu(hdr->MessageId),
|
||||
le64_to_cpu(rsp->PersistentFileId),
|
||||
le64_to_cpu(rsp->VolatileFileId));
|
||||
if (rc)
|
||||
cifs_put_tcon(tcon);
|
||||
|
||||
@@ -856,10 +855,10 @@ smb311_update_preauth_hash(struct cifs_ses *ses, struct kvec *iov, int nvec)
|
||||
{
|
||||
int i, rc;
|
||||
struct sdesc *d;
|
||||
struct smb2_sync_hdr *hdr;
|
||||
struct smb2_hdr *hdr;
|
||||
struct TCP_Server_Info *server = cifs_ses_server(ses);
|
||||
|
||||
hdr = (struct smb2_sync_hdr *)iov[0].iov_base;
|
||||
hdr = (struct smb2_hdr *)iov[0].iov_base;
|
||||
/* neg prot are always taken */
|
||||
if (hdr->Command == SMB2_NEGOTIATE)
|
||||
goto ok;
|
||||
|
||||
@@ -325,7 +325,7 @@ static struct mid_q_entry *
|
||||
__smb2_find_mid(struct TCP_Server_Info *server, char *buf, bool dequeue)
|
||||
{
|
||||
struct mid_q_entry *mid;
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
__u64 wire_mid = le64_to_cpu(shdr->MessageId);
|
||||
|
||||
if (shdr->ProtocolId == SMB2_TRANSFORM_PROTO_NUM) {
|
||||
@@ -367,11 +367,11 @@ static void
|
||||
smb2_dump_detail(void *buf, struct TCP_Server_Info *server)
|
||||
{
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
|
||||
cifs_server_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n",
|
||||
shdr->Command, shdr->Status, shdr->Flags, shdr->MessageId,
|
||||
shdr->ProcessId);
|
||||
shdr->Id.SyncId.ProcessId);
|
||||
cifs_server_dbg(VFS, "smb buf %p len %u\n", buf,
|
||||
server->ops->calc_smb_size(buf, server));
|
||||
#endif
|
||||
@@ -885,10 +885,10 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
|
||||
atomic_inc(&tcon->num_remote_opens);
|
||||
|
||||
o_rsp = (struct smb2_create_rsp *)rsp_iov[0].iov_base;
|
||||
oparms.fid->persistent_fid = o_rsp->PersistentFileId;
|
||||
oparms.fid->volatile_fid = o_rsp->VolatileFileId;
|
||||
oparms.fid->persistent_fid = le64_to_cpu(o_rsp->PersistentFileId);
|
||||
oparms.fid->volatile_fid = le64_to_cpu(o_rsp->VolatileFileId);
|
||||
#ifdef CONFIG_CIFS_DEBUG2
|
||||
oparms.fid->mid = le64_to_cpu(o_rsp->sync_hdr.MessageId);
|
||||
oparms.fid->mid = le64_to_cpu(o_rsp->hdr.MessageId);
|
||||
#endif /* CIFS_DEBUG2 */
|
||||
|
||||
tcon->crfid.tcon = tcon;
|
||||
@@ -2391,12 +2391,12 @@ again:
|
||||
|
||||
/* If the open failed there is nothing to do */
|
||||
op_rsp = (struct smb2_create_rsp *)rsp_iov[0].iov_base;
|
||||
if (op_rsp == NULL || op_rsp->sync_hdr.Status != STATUS_SUCCESS) {
|
||||
if (op_rsp == NULL || op_rsp->hdr.Status != STATUS_SUCCESS) {
|
||||
cifs_dbg(FYI, "query_dir_first: open failed rc=%d\n", rc);
|
||||
goto qdf_free;
|
||||
}
|
||||
fid->persistent_fid = op_rsp->PersistentFileId;
|
||||
fid->volatile_fid = op_rsp->VolatileFileId;
|
||||
fid->persistent_fid = le64_to_cpu(op_rsp->PersistentFileId);
|
||||
fid->volatile_fid = le64_to_cpu(op_rsp->VolatileFileId);
|
||||
|
||||
/* Anything else than ENODATA means a genuine error */
|
||||
if (rc && rc != -ENODATA) {
|
||||
@@ -2410,7 +2410,7 @@ again:
|
||||
atomic_inc(&tcon->num_remote_opens);
|
||||
|
||||
qd_rsp = (struct smb2_query_directory_rsp *)rsp_iov[1].iov_base;
|
||||
if (qd_rsp->sync_hdr.Status == STATUS_NO_MORE_FILES) {
|
||||
if (qd_rsp->hdr.Status == STATUS_NO_MORE_FILES) {
|
||||
trace_smb3_query_dir_done(xid, fid->persistent_fid,
|
||||
tcon->tid, tcon->ses->Suid, 0, 0);
|
||||
srch_inf->endOfSearch = true;
|
||||
@@ -2462,7 +2462,7 @@ smb2_close_dir(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
static bool
|
||||
smb2_is_status_pending(char *buf, struct TCP_Server_Info *server)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
int scredits, in_flight;
|
||||
|
||||
if (shdr->Status != STATUS_PENDING)
|
||||
@@ -2489,13 +2489,14 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server)
|
||||
static bool
|
||||
smb2_is_session_expired(char *buf)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
|
||||
if (shdr->Status != STATUS_NETWORK_SESSION_EXPIRED &&
|
||||
shdr->Status != STATUS_USER_SESSION_DELETED)
|
||||
return false;
|
||||
|
||||
trace_smb3_ses_expired(shdr->TreeId, shdr->SessionId,
|
||||
trace_smb3_ses_expired(le32_to_cpu(shdr->Id.SyncId.TreeId),
|
||||
le64_to_cpu(shdr->SessionId),
|
||||
le16_to_cpu(shdr->Command),
|
||||
le64_to_cpu(shdr->MessageId));
|
||||
cifs_dbg(FYI, "Session expired or deleted\n");
|
||||
@@ -2506,7 +2507,7 @@ smb2_is_session_expired(char *buf)
|
||||
static bool
|
||||
smb2_is_status_io_timeout(char *buf)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
|
||||
if (shdr->Status == STATUS_IO_TIMEOUT)
|
||||
return true;
|
||||
@@ -2517,7 +2518,7 @@ smb2_is_status_io_timeout(char *buf)
|
||||
static void
|
||||
smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
struct list_head *tmp, *tmp1;
|
||||
struct cifs_ses *ses;
|
||||
struct cifs_tcon *tcon;
|
||||
@@ -2530,7 +2531,7 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
|
||||
ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
|
||||
list_for_each(tmp1, &ses->tcon_list) {
|
||||
tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
|
||||
if (tcon->tid == shdr->TreeId) {
|
||||
if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) {
|
||||
tcon->need_reconnect = true;
|
||||
spin_unlock(&cifs_tcp_ses_lock);
|
||||
pr_warn_once("Server share %s deleted.\n",
|
||||
@@ -2558,9 +2559,9 @@ smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid,
|
||||
void
|
||||
smb2_set_related(struct smb_rqst *rqst)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr;
|
||||
struct smb2_hdr *shdr;
|
||||
|
||||
shdr = (struct smb2_sync_hdr *)(rqst->rq_iov[0].iov_base);
|
||||
shdr = (struct smb2_hdr *)(rqst->rq_iov[0].iov_base);
|
||||
if (shdr == NULL) {
|
||||
cifs_dbg(FYI, "shdr NULL in smb2_set_related\n");
|
||||
return;
|
||||
@@ -2573,13 +2574,13 @@ char smb2_padding[7] = {0, 0, 0, 0, 0, 0, 0};
|
||||
void
|
||||
smb2_set_next_command(struct cifs_tcon *tcon, struct smb_rqst *rqst)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr;
|
||||
struct smb2_hdr *shdr;
|
||||
struct cifs_ses *ses = tcon->ses;
|
||||
struct TCP_Server_Info *server = ses->server;
|
||||
unsigned long len = smb_rqst_len(server, rqst);
|
||||
int i, num_padding;
|
||||
|
||||
shdr = (struct smb2_sync_hdr *)(rqst->rq_iov[0].iov_base);
|
||||
shdr = (struct smb2_hdr *)(rqst->rq_iov[0].iov_base);
|
||||
if (shdr == NULL) {
|
||||
cifs_dbg(FYI, "shdr NULL in smb2_set_next_command\n");
|
||||
return;
|
||||
@@ -3124,7 +3125,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
resp_buftype, rsp_iov);
|
||||
|
||||
create_rsp = rsp_iov[0].iov_base;
|
||||
if (create_rsp && create_rsp->sync_hdr.Status)
|
||||
if (create_rsp && create_rsp->hdr.Status)
|
||||
err_iov = rsp_iov[0];
|
||||
ioctl_rsp = rsp_iov[1].iov_base;
|
||||
|
||||
@@ -4369,8 +4370,8 @@ static void
|
||||
fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len,
|
||||
struct smb_rqst *old_rq, __le16 cipher_type)
|
||||
{
|
||||
struct smb2_sync_hdr *shdr =
|
||||
(struct smb2_sync_hdr *)old_rq->rq_iov[0].iov_base;
|
||||
struct smb2_hdr *shdr =
|
||||
(struct smb2_hdr *)old_rq->rq_iov[0].iov_base;
|
||||
|
||||
memset(tr_hdr, 0, sizeof(struct smb2_transform_hdr));
|
||||
tr_hdr->ProtocolId = SMB2_TRANSFORM_PROTO_NUM;
|
||||
@@ -4496,7 +4497,7 @@ crypt_message(struct TCP_Server_Info *server, int num_rqst,
|
||||
struct crypto_aead *tfm;
|
||||
unsigned int crypt_len = le32_to_cpu(tr_hdr->OriginalMessageSize);
|
||||
|
||||
rc = smb2_get_enc_key(server, tr_hdr->SessionId, enc, key);
|
||||
rc = smb2_get_enc_key(server, le64_to_cpu(tr_hdr->SessionId), enc, key);
|
||||
if (rc) {
|
||||
cifs_server_dbg(VFS, "%s: Could not get %scryption key\n", __func__,
|
||||
enc ? "en" : "de");
|
||||
@@ -4788,7 +4789,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
|
||||
unsigned int cur_page_idx;
|
||||
unsigned int pad_len;
|
||||
struct cifs_readdata *rdata = mid->callback_data;
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)buf;
|
||||
struct bio_vec *bvec = NULL;
|
||||
struct iov_iter iter;
|
||||
struct kvec iov;
|
||||
@@ -5117,7 +5118,7 @@ receive_encrypted_standard(struct TCP_Server_Info *server,
|
||||
{
|
||||
int ret, length;
|
||||
char *buf = server->smallbuf;
|
||||
struct smb2_sync_hdr *shdr;
|
||||
struct smb2_hdr *shdr;
|
||||
unsigned int pdu_length = server->pdu_size;
|
||||
unsigned int buf_size;
|
||||
struct mid_q_entry *mid_entry;
|
||||
@@ -5147,7 +5148,7 @@ receive_encrypted_standard(struct TCP_Server_Info *server,
|
||||
|
||||
next_is_large = server->large_buf;
|
||||
one_more:
|
||||
shdr = (struct smb2_sync_hdr *)buf;
|
||||
shdr = (struct smb2_hdr *)buf;
|
||||
if (shdr->NextCommand) {
|
||||
if (next_is_large)
|
||||
next_buffer = (char *)cifs_buf_get();
|
||||
@@ -5213,7 +5214,7 @@ smb3_receive_transform(struct TCP_Server_Info *server,
|
||||
unsigned int orig_len = le32_to_cpu(tr_hdr->OriginalMessageSize);
|
||||
|
||||
if (pdu_length < sizeof(struct smb2_transform_hdr) +
|
||||
sizeof(struct smb2_sync_hdr)) {
|
||||
sizeof(struct smb2_hdr)) {
|
||||
cifs_server_dbg(VFS, "Transform message is too small (%u)\n",
|
||||
pdu_length);
|
||||
cifs_reconnect(server);
|
||||
@@ -5246,7 +5247,7 @@ smb3_handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid)
|
||||
static int
|
||||
smb2_next_header(char *buf)
|
||||
{
|
||||
struct smb2_sync_hdr *hdr = (struct smb2_sync_hdr *)buf;
|
||||
struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
|
||||
struct smb2_transform_hdr *t_hdr = (struct smb2_transform_hdr *)buf;
|
||||
|
||||
if (hdr->ProtocolId == SMB2_TRANSFORM_PROTO_NUM)
|
||||
@@ -5788,7 +5789,7 @@ struct smb_version_values smb20_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5809,7 +5810,7 @@ struct smb_version_values smb21_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5830,7 +5831,7 @@ struct smb_version_values smb3any_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5851,7 +5852,7 @@ struct smb_version_values smbdefault_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5872,7 +5873,7 @@ struct smb_version_values smb30_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5893,7 +5894,7 @@ struct smb_version_values smb302_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
@@ -5914,7 +5915,7 @@ struct smb_version_values smb311_values = {
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
.unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
|
||||
.header_size = sizeof(struct smb2_sync_hdr),
|
||||
.header_size = sizeof(struct smb2_hdr),
|
||||
.header_preamble_size = 0,
|
||||
.max_header_size = MAX_SMB2_HDR_SIZE,
|
||||
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ extern int smb2_check_message(char *buf, unsigned int length,
|
||||
struct TCP_Server_Info *server);
|
||||
extern unsigned int smb2_calc_size(void *buf, struct TCP_Server_Info *server);
|
||||
extern char *smb2_get_data_area_len(int *off, int *len,
|
||||
struct smb2_sync_hdr *shdr);
|
||||
struct smb2_hdr *shdr);
|
||||
extern __le16 *cifs_convert_path_to_utf16(const char *from,
|
||||
struct cifs_sb_info *cifs_sb);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <linux/mempool.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <crypto/aead.h>
|
||||
#include "smb2pdu.h"
|
||||
#include "cifsglob.h"
|
||||
#include "cifsproto.h"
|
||||
#include "smb2proto.h"
|
||||
@@ -213,14 +212,14 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server,
|
||||
unsigned char smb2_signature[SMB2_HMACSHA256_SIZE];
|
||||
unsigned char *sigptr = smb2_signature;
|
||||
struct kvec *iov = rqst->rq_iov;
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)iov[0].iov_base;
|
||||
struct cifs_ses *ses;
|
||||
struct shash_desc *shash;
|
||||
struct crypto_shash *hash;
|
||||
struct sdesc *sdesc = NULL;
|
||||
struct smb_rqst drqst;
|
||||
|
||||
ses = smb2_find_smb_ses(server, shdr->SessionId);
|
||||
ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId));
|
||||
if (!ses) {
|
||||
cifs_server_dbg(VFS, "%s: Could not find session\n", __func__);
|
||||
return 0;
|
||||
@@ -534,14 +533,14 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server,
|
||||
unsigned char smb3_signature[SMB2_CMACAES_SIZE];
|
||||
unsigned char *sigptr = smb3_signature;
|
||||
struct kvec *iov = rqst->rq_iov;
|
||||
struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base;
|
||||
struct smb2_hdr *shdr = (struct smb2_hdr *)iov[0].iov_base;
|
||||
struct shash_desc *shash;
|
||||
struct crypto_shash *hash;
|
||||
struct sdesc *sdesc = NULL;
|
||||
struct smb_rqst drqst;
|
||||
u8 key[SMB3_SIGN_KEY_SIZE];
|
||||
|
||||
rc = smb2_get_sign_key(shdr->SessionId, server, key);
|
||||
rc = smb2_get_sign_key(le64_to_cpu(shdr->SessionId), server, key);
|
||||
if (rc)
|
||||
return 0;
|
||||
|
||||
@@ -611,12 +610,12 @@ static int
|
||||
smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server)
|
||||
{
|
||||
int rc = 0;
|
||||
struct smb2_sync_hdr *shdr;
|
||||
struct smb2_hdr *shdr;
|
||||
struct smb2_sess_setup_req *ssr;
|
||||
bool is_binding;
|
||||
bool is_signed;
|
||||
|
||||
shdr = (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
|
||||
shdr = (struct smb2_hdr *)rqst->rq_iov[0].iov_base;
|
||||
ssr = (struct smb2_sess_setup_req *)shdr;
|
||||
|
||||
is_binding = shdr->Command == SMB2_SESSION_SETUP &&
|
||||
@@ -642,8 +641,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
|
||||
{
|
||||
unsigned int rc;
|
||||
char server_response_sig[SMB2_SIGNATURE_SIZE];
|
||||
struct smb2_sync_hdr *shdr =
|
||||
(struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
|
||||
struct smb2_hdr *shdr =
|
||||
(struct smb2_hdr *)rqst->rq_iov[0].iov_base;
|
||||
|
||||
if ((shdr->Command == SMB2_NEGOTIATE) ||
|
||||
(shdr->Command == SMB2_SESSION_SETUP) ||
|
||||
@@ -689,7 +688,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
|
||||
*/
|
||||
static inline void
|
||||
smb2_seq_num_into_buf(struct TCP_Server_Info *server,
|
||||
struct smb2_sync_hdr *shdr)
|
||||
struct smb2_hdr *shdr)
|
||||
{
|
||||
unsigned int i, num = le16_to_cpu(shdr->CreditCharge);
|
||||
|
||||
@@ -700,7 +699,7 @@ smb2_seq_num_into_buf(struct TCP_Server_Info *server,
|
||||
}
|
||||
|
||||
static struct mid_q_entry *
|
||||
smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr,
|
||||
smb2_mid_entry_alloc(const struct smb2_hdr *shdr,
|
||||
struct TCP_Server_Info *server)
|
||||
{
|
||||
struct mid_q_entry *temp;
|
||||
@@ -732,14 +731,15 @@ smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr,
|
||||
|
||||
atomic_inc(&midCount);
|
||||
temp->mid_state = MID_REQUEST_ALLOCATED;
|
||||
trace_smb3_cmd_enter(shdr->TreeId, shdr->SessionId,
|
||||
le16_to_cpu(shdr->Command), temp->mid);
|
||||
trace_smb3_cmd_enter(le32_to_cpu(shdr->Id.SyncId.TreeId),
|
||||
le64_to_cpu(shdr->SessionId),
|
||||
le16_to_cpu(shdr->Command), temp->mid);
|
||||
return temp;
|
||||
}
|
||||
|
||||
static int
|
||||
smb2_get_mid_entry(struct cifs_ses *ses, struct TCP_Server_Info *server,
|
||||
struct smb2_sync_hdr *shdr, struct mid_q_entry **mid)
|
||||
struct smb2_hdr *shdr, struct mid_q_entry **mid)
|
||||
{
|
||||
if (server->tcpStatus == CifsExiting)
|
||||
return -ENOENT;
|
||||
@@ -807,8 +807,8 @@ smb2_setup_request(struct cifs_ses *ses, struct TCP_Server_Info *server,
|
||||
struct smb_rqst *rqst)
|
||||
{
|
||||
int rc;
|
||||
struct smb2_sync_hdr *shdr =
|
||||
(struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
|
||||
struct smb2_hdr *shdr =
|
||||
(struct smb2_hdr *)rqst->rq_iov[0].iov_base;
|
||||
struct mid_q_entry *mid;
|
||||
|
||||
smb2_seq_num_into_buf(server, shdr);
|
||||
@@ -833,8 +833,8 @@ struct mid_q_entry *
|
||||
smb2_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst)
|
||||
{
|
||||
int rc;
|
||||
struct smb2_sync_hdr *shdr =
|
||||
(struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
|
||||
struct smb2_hdr *shdr =
|
||||
(struct smb2_hdr *)rqst->rq_iov[0].iov_base;
|
||||
struct mid_q_entry *mid;
|
||||
|
||||
if (server->tcpStatus == CifsNeedNegotiate &&
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#define _CIFS_TRACE_H
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
#include <linux/net.h>
|
||||
#include <linux/inet.h>
|
||||
|
||||
/*
|
||||
* Please use this 3-part article as a reference for writing new tracepoints:
|
||||
@@ -854,6 +856,75 @@ DEFINE_EVENT(smb3_lease_err_class, smb3_##name, \
|
||||
|
||||
DEFINE_SMB3_LEASE_ERR_EVENT(lease_err);
|
||||
|
||||
DECLARE_EVENT_CLASS(smb3_connect_class,
|
||||
TP_PROTO(char *hostname,
|
||||
__u64 conn_id,
|
||||
const struct __kernel_sockaddr_storage *dst_addr),
|
||||
TP_ARGS(hostname, conn_id, dst_addr),
|
||||
TP_STRUCT__entry(
|
||||
__string(hostname, hostname)
|
||||
__field(__u64, conn_id)
|
||||
__array(__u8, dst_addr, sizeof(struct sockaddr_storage))
|
||||
),
|
||||
TP_fast_assign(
|
||||
struct sockaddr_storage *pss = NULL;
|
||||
|
||||
__entry->conn_id = conn_id;
|
||||
pss = (struct sockaddr_storage *)__entry->dst_addr;
|
||||
*pss = *dst_addr;
|
||||
__assign_str(hostname, hostname);
|
||||
),
|
||||
TP_printk("conn_id=0x%llx server=%s addr=%pISpsfc",
|
||||
__entry->conn_id,
|
||||
__get_str(hostname),
|
||||
__entry->dst_addr)
|
||||
)
|
||||
|
||||
#define DEFINE_SMB3_CONNECT_EVENT(name) \
|
||||
DEFINE_EVENT(smb3_connect_class, smb3_##name, \
|
||||
TP_PROTO(char *hostname, \
|
||||
__u64 conn_id, \
|
||||
const struct __kernel_sockaddr_storage *addr), \
|
||||
TP_ARGS(hostname, conn_id, addr))
|
||||
|
||||
DEFINE_SMB3_CONNECT_EVENT(connect_done);
|
||||
|
||||
DECLARE_EVENT_CLASS(smb3_connect_err_class,
|
||||
TP_PROTO(char *hostname, __u64 conn_id,
|
||||
const struct __kernel_sockaddr_storage *dst_addr, int rc),
|
||||
TP_ARGS(hostname, conn_id, dst_addr, rc),
|
||||
TP_STRUCT__entry(
|
||||
__string(hostname, hostname)
|
||||
__field(__u64, conn_id)
|
||||
__array(__u8, dst_addr, sizeof(struct sockaddr_storage))
|
||||
__field(int, rc)
|
||||
),
|
||||
TP_fast_assign(
|
||||
struct sockaddr_storage *pss = NULL;
|
||||
|
||||
__entry->conn_id = conn_id;
|
||||
__entry->rc = rc;
|
||||
pss = (struct sockaddr_storage *)__entry->dst_addr;
|
||||
*pss = *dst_addr;
|
||||
__assign_str(hostname, hostname);
|
||||
),
|
||||
TP_printk("rc=%d conn_id=0x%llx server=%s addr=%pISpsfc",
|
||||
__entry->rc,
|
||||
__entry->conn_id,
|
||||
__get_str(hostname),
|
||||
__entry->dst_addr)
|
||||
)
|
||||
|
||||
#define DEFINE_SMB3_CONNECT_ERR_EVENT(name) \
|
||||
DEFINE_EVENT(smb3_connect_err_class, smb3_##name, \
|
||||
TP_PROTO(char *hostname, \
|
||||
__u64 conn_id, \
|
||||
const struct __kernel_sockaddr_storage *addr, \
|
||||
int rc), \
|
||||
TP_ARGS(hostname, conn_id, addr, rc))
|
||||
|
||||
DEFINE_SMB3_CONNECT_ERR_EVENT(connect_err);
|
||||
|
||||
DECLARE_EVENT_CLASS(smb3_reconnect_class,
|
||||
TP_PROTO(__u64 currmid,
|
||||
__u64 conn_id,
|
||||
|
||||
989
fs/smbfs_common/smb2pdu.h
Normal file
989
fs/smbfs_common/smb2pdu.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user