From 150fc2fcdc76ea53861214493e6b66a443353f6c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 24 Oct 2022 13:02:15 +0200 Subject: [PATCH] drop some 5.15 patches --- .../bpf-remove-unused-static-inlines.patch | 89 - ...w-shared-file-holding-smb2-pdu-defin.patch | 2080 ----------------- ...turn-correct-error-in-calc_signature.patch | 16 +- ...g-of-oversized-nfsv4-compound-reques.patch | 33 +- ...rr_serverfault-if-splice_ok-but-buf-.patch | 9 +- ...c-add-new-routine-nvme_fc_io_getuuid.patch | 93 - queue-5.15/series | 5 - ...ange-return-value-type-of-.pc_decode.patch | 1350 ----------- ...the-__be32-p-parameter-to-.pc_decode.patch | 849 ------- ...xsk-fix-backpressure-mechanism-on-tx.patch | 27 +- 10 files changed, 30 insertions(+), 4521 deletions(-) delete mode 100644 queue-5.15/bpf-remove-unused-static-inlines.patch delete mode 100644 queue-5.15/cifs-create-a-new-shared-file-holding-smb2-pdu-defin.patch delete mode 100644 queue-5.15/scsi-nvme-fc-add-new-routine-nvme_fc_io_getuuid.patch delete mode 100644 queue-5.15/sunrpc-change-return-value-type-of-.pc_decode.patch delete mode 100644 queue-5.15/sunrpc-replace-the-__be32-p-parameter-to-.pc_decode.patch diff --git a/queue-5.15/bpf-remove-unused-static-inlines.patch b/queue-5.15/bpf-remove-unused-static-inlines.patch deleted file mode 100644 index ed60a2e5ccf..00000000000 --- a/queue-5.15/bpf-remove-unused-static-inlines.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 215338d3fadc32e403b3bf151edfd0da83948f93 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 26 Jan 2022 10:54:12 -0800 -Subject: bpf: remove unused static inlines - -From: Jakub Kicinski - -[ Upstream commit 8033c6c2fed235b3d571b5a5ede302b752bc5c7d ] - -Remove two dead stubs, sk_msg_clear_meta() was never -used, use of xskq_cons_is_full() got replaced by -xsk_tx_writeable() in v5.10. - -Signed-off-by: Jakub Kicinski -Link: https://lore.kernel.org/r/20220126185412.2776254-1-kuba@kernel.org -Signed-off-by: Alexei Starovoitov -Stable-dep-of: c00c4461689e ("xsk: Fix backpressure mechanism on Tx") -Signed-off-by: Sasha Levin ---- - include/linux/bpf.h | 10 ---------- - include/linux/skmsg.h | 5 ----- - net/xdp/xsk_queue.h | 7 ------- - 3 files changed, 22 deletions(-) - -diff --git a/include/linux/bpf.h b/include/linux/bpf.h -index 818cd594e922..2463c2ed5922 100644 ---- a/include/linux/bpf.h -+++ b/include/linux/bpf.h -@@ -1800,11 +1800,6 @@ static inline int bpf_obj_get_user(const char __user *pathname, int flags) - return -EOPNOTSUPP; - } - --static inline bool dev_map_can_have_prog(struct bpf_map *map) --{ -- return false; --} -- - static inline void __dev_flush(void) - { - } -@@ -1868,11 +1863,6 @@ static inline int cpu_map_generic_redirect(struct bpf_cpu_map_entry *rcpu, - return -EOPNOTSUPP; - } - --static inline bool cpu_map_prog_allowed(struct bpf_map *map) --{ -- return false; --} -- - static inline struct bpf_prog *bpf_prog_get_type_path(const char *name, - enum bpf_prog_type type) - { -diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h -index 0c742cdf413c..13652d225b81 100644 ---- a/include/linux/skmsg.h -+++ b/include/linux/skmsg.h -@@ -171,11 +171,6 @@ static inline u32 sk_msg_iter_dist(u32 start, u32 end) - #define sk_msg_iter_next(msg, which) \ - sk_msg_iter_var_next(msg->sg.which) - --static inline void sk_msg_clear_meta(struct sk_msg *msg) --{ -- memset(&msg->sg, 0, offsetofend(struct sk_msg_sg, copy)); --} -- - static inline void sk_msg_init(struct sk_msg *msg) - { - BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != NR_MSG_FRAG_IDS); -diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h -index 491a18c1f786..0e59b4611f18 100644 ---- a/net/xdp/xsk_queue.h -+++ b/net/xdp/xsk_queue.h -@@ -292,13 +292,6 @@ static inline void xskq_cons_release_n(struct xsk_queue *q, u32 cnt) - q->cached_cons += cnt; - } - --static inline bool xskq_cons_is_full(struct xsk_queue *q) --{ -- /* No barriers needed since data is not accessed */ -- return READ_ONCE(q->ring->producer) - READ_ONCE(q->ring->consumer) == -- q->nentries; --} -- - static inline u32 xskq_cons_present_entries(struct xsk_queue *q) - { - /* No barriers needed since data is not accessed */ --- -2.35.1 - diff --git a/queue-5.15/cifs-create-a-new-shared-file-holding-smb2-pdu-defin.patch b/queue-5.15/cifs-create-a-new-shared-file-holding-smb2-pdu-defin.patch deleted file mode 100644 index 6c798f9ea1a..00000000000 --- a/queue-5.15/cifs-create-a-new-shared-file-holding-smb2-pdu-defin.patch +++ /dev/null @@ -1,2080 +0,0 @@ -From 05f8551778b6a9bb80094575b82ff7f17605392a Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 5 Nov 2021 08:39:01 +0900 -Subject: cifs: Create a new shared file holding smb2 pdu definitions - -From: Ronnie Sahlberg - -[ Upstream commit 0d35e382e4e96a4fd97a1438bc1b11a91d2d85a6 ] - -This file will contain all the definitions we need for SMB2 packets -and will follow the naming convention of MS-SMB2.PDF as closely -as possible to make it easier to cross-reference beween the definitions -and the standard. - -The content of this file will mostly consist of migration of existing -definitions in the cifs/smb2.pdu.h and ksmbd/smb2pdu.h files -with some additional tweaks as the two files have diverged. - -This patch introduces the new smbfs_common/smb2pdu.h file -and migrates the SMB2 header as well as TREE_CONNECT and TREE_DISCONNECT -to the shared file. - -Signed-off-by: Ronnie Sahlberg -Reviewed-by: Namjae Jeon -Signed-off-by: Steve French -Stable-dep-of: 09a1f9a168ae ("cifs: return correct error in ->calc_signature()") -Signed-off-by: Sasha Levin ---- - fs/cifs/cifsfs.c | 1 - - fs/cifs/cifsglob.h | 3 +- - fs/cifs/connect.c | 4 +- - fs/cifs/misc.c | 2 +- - fs/cifs/smb2maperror.c | 16 +- - fs/cifs/smb2misc.c | 43 +++-- - fs/cifs/smb2ops.c | 65 +++---- - fs/cifs/smb2pdu.c | 106 ++++++----- - fs/cifs/smb2pdu.h | 373 ++++---------------------------------- - fs/cifs/smb2proto.h | 2 +- - fs/cifs/smb2transport.c | 36 ++-- - fs/smbfs_common/smb2pdu.h | 318 ++++++++++++++++++++++++++++++++ - 12 files changed, 493 insertions(+), 476 deletions(-) - create mode 100644 fs/smbfs_common/smb2pdu.h - -diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c -index 8ec55bbd705d..482dc5e50852 100644 ---- a/fs/cifs/cifsfs.c -+++ b/fs/cifs/cifsfs.c -@@ -38,7 +38,6 @@ - #include - #include "cifs_spnego.h" - #include "fscache.h" --#include "smb2pdu.h" - #ifdef CONFIG_CIFS_DFS_UPCALL - #include "dfs_cache.h" - #endif -diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h -index a97ed30843cf..24ea63590d8d 100644 ---- a/fs/cifs/cifsglob.h -+++ b/fs/cifs/cifsglob.h -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include "../smbfs_common/smb2pdu.h" - #include "smb2pdu.h" - - #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ -@@ -778,7 +779,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); - -diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c -index 278634a63895..05f32cd8435d 100644 ---- a/fs/cifs/connect.c -+++ b/fs/cifs/connect.c -@@ -672,7 +672,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. -@@ -872,7 +872,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; - - /* -diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c -index 699f676ded47..ff8684512171 100644 ---- a/fs/cifs/misc.c -+++ b/fs/cifs/misc.c -@@ -153,7 +153,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 - -diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c -index 181514b8770d..194799ddd382 100644 ---- a/fs/cifs/smb2maperror.c -+++ b/fs/cifs/smb2maperror.c -@@ -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; - } -diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c -index 29b5554f6263..ce7d6cc652b3 100644 ---- a/fs/cifs/smb2misc.c -+++ b/fs/cifs/smb2misc.c -@@ -8,7 +8,6 @@ - * - */ - #include --#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,23 +815,23 @@ 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), -+ le16_to_cpu(hdr->Command), -+ le64_to_cpu(hdr->MessageId), - rsp->PersistentFileId, - rsp->VolatileFileId); - if (rc) -@@ -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; -diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c -index 2d31860d56e9..b13d0ce3b876 100644 ---- a/fs/cifs/smb2ops.c -+++ b/fs/cifs/smb2ops.c -@@ -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 -@@ -891,7 +891,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, - oparms.fid->persistent_fid = o_rsp->PersistentFileId; - oparms.fid->volatile_fid = 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; -@@ -2413,7 +2413,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, - - /* 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; - } -@@ -2432,7 +2432,7 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon, - 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; -@@ -2484,7 +2484,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) -@@ -2511,13 +2511,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"); -@@ -2528,7 +2529,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; -@@ -2539,7 +2540,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; -@@ -2552,7 +2553,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", -@@ -2580,9 +2581,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; -@@ -2595,13 +2596,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; -@@ -3146,7 +3147,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; - -@@ -4393,8 +4394,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; -@@ -4520,7 +4521,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"); -@@ -4812,7 +4813,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; -@@ -5141,7 +5142,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; -@@ -5171,7 +5172,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(); -@@ -5237,7 +5238,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); -@@ -5270,7 +5271,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) -@@ -5814,7 +5815,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, -@@ -5836,7 +5837,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, -@@ -5857,7 +5858,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, -@@ -5878,7 +5879,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, -@@ -5899,7 +5900,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, -@@ -5920,7 +5921,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, -@@ -5941,7 +5942,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, -diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c -index 8aa0372141f5..4790499c1a22 100644 ---- a/fs/cifs/smb2pdu.c -+++ b/fs/cifs/smb2pdu.c -@@ -23,7 +23,6 @@ - #include - #include - #include --#include "smb2pdu.h" - #include "cifsglob.h" - #include "cifsacl.h" - #include "cifsproto.h" -@@ -84,7 +83,7 @@ int smb3_encryption_required(const struct cifs_tcon *tcon) - } - - static void --smb2_hdr_assemble(struct smb2_sync_hdr *shdr, __le16 smb2_cmd, -+smb2_hdr_assemble(struct smb2_hdr *shdr, __le16 smb2_cmd, - const struct cifs_tcon *tcon, - struct TCP_Server_Info *server) - { -@@ -104,7 +103,7 @@ smb2_hdr_assemble(struct smb2_sync_hdr *shdr, __le16 smb2_cmd, - } else { - shdr->CreditRequest = cpu_to_le16(2); - } -- shdr->ProcessId = cpu_to_le32((__u16)current->tgid); -+ shdr->Id.SyncId.ProcessId = cpu_to_le32((__u16)current->tgid); - - if (!tcon) - goto out; -@@ -115,10 +114,10 @@ smb2_hdr_assemble(struct smb2_sync_hdr *shdr, __le16 smb2_cmd, - shdr->CreditCharge = cpu_to_le16(1); - /* else CreditCharge MBZ */ - -- shdr->TreeId = tcon->tid; -+ shdr->Id.SyncId.TreeId = cpu_to_le32(tcon->tid); - /* Uid is not converted */ - if (tcon->ses) -- shdr->SessionId = tcon->ses->Suid; -+ shdr->SessionId = cpu_to_le64(tcon->ses->Suid); - - /* - * If we would set SMB2_FLAGS_DFS_OPERATIONS on open we also would have -@@ -334,7 +333,7 @@ fill_small_buf(__le16 smb2_command, struct cifs_tcon *tcon, - void *buf, - unsigned int *total_len) - { -- struct smb2_sync_pdu *spdu = (struct smb2_sync_pdu *)buf; -+ struct smb2_pdu *spdu = (struct smb2_pdu *)buf; - /* lookup word count ie StructureSize from table */ - __u16 parmsize = smb2_req_struct_sizes[le16_to_cpu(smb2_command)]; - -@@ -344,10 +343,10 @@ fill_small_buf(__le16 smb2_command, struct cifs_tcon *tcon, - */ - memset(buf, 0, 256); - -- smb2_hdr_assemble(&spdu->sync_hdr, smb2_command, tcon, server); -+ smb2_hdr_assemble(&spdu->hdr, smb2_command, tcon, server); - spdu->StructureSize2 = cpu_to_le16(parmsize); - -- *total_len = parmsize + sizeof(struct smb2_sync_hdr); -+ *total_len = parmsize + sizeof(struct smb2_hdr); - } - - /* -@@ -370,7 +369,7 @@ static int __smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon, - } - - fill_small_buf(smb2_command, tcon, server, -- (struct smb2_sync_hdr *)(*request_buf), -+ (struct smb2_hdr *)(*request_buf), - total_len); - - if (tcon != NULL) { -@@ -860,7 +859,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) - if (rc) - return rc; - -- req->sync_hdr.SessionId = 0; -+ req->hdr.SessionId = 0; - - memset(server->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE); - memset(ses->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE); -@@ -1023,7 +1022,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) - server->cipher_type = SMB2_ENCRYPTION_AES128_CCM; - - security_blob = smb2_get_data_area_len(&blob_offset, &blob_length, -- (struct smb2_sync_hdr *)rsp); -+ (struct smb2_hdr *)rsp); - /* - * See MS-SMB2 section 2.2.4: if no blob, client picks default which - * for us will be -@@ -1255,13 +1254,13 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) - return rc; - - if (sess_data->ses->binding) { -- req->sync_hdr.SessionId = sess_data->ses->Suid; -- req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; -+ req->hdr.SessionId = cpu_to_le64(sess_data->ses->Suid); -+ req->hdr.Flags |= SMB2_FLAGS_SIGNED; - req->PreviousSessionId = 0; - req->Flags = SMB2_SESSION_REQ_FLAG_BINDING; - } else { - /* First session, not a reauthenticate */ -- req->sync_hdr.SessionId = 0; -+ req->hdr.SessionId = 0; - /* - * if reconnect, we need to send previous sess id - * otherwise it is 0 -@@ -1271,7 +1270,7 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) - } - - /* enough to enable echos and oplocks and one max size write */ -- req->sync_hdr.CreditRequest = cpu_to_le16(130); -+ req->hdr.CreditRequest = cpu_to_le16(130); - - /* only one of SMB2 signing flags may be set in SMB2 request */ - if (server->sign) -@@ -1430,7 +1429,7 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data) - rsp = (struct smb2_sess_setup_rsp *)sess_data->iov[0].iov_base; - /* keep session id and flags if binding */ - if (!ses->binding) { -- ses->Suid = rsp->sync_hdr.SessionId; -+ ses->Suid = le64_to_cpu(rsp->hdr.SessionId); - ses->session_flags = le16_to_cpu(rsp->SessionFlags); - } - -@@ -1506,7 +1505,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) - - /* If true, rc here is expected and not an error */ - if (sess_data->buf0_type != CIFS_NO_BUFFER && -- rsp->sync_hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) -+ rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) - rc = 0; - - if (rc) -@@ -1528,7 +1527,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) - - /* keep existing ses id and flags if binding */ - if (!ses->binding) { -- ses->Suid = rsp->sync_hdr.SessionId; -+ ses->Suid = le64_to_cpu(rsp->hdr.SessionId); - ses->session_flags = le16_to_cpu(rsp->SessionFlags); - } - -@@ -1563,7 +1562,7 @@ SMB2_sess_auth_rawntlmssp_authenticate(struct SMB2_sess_data *sess_data) - goto out; - - req = (struct smb2_sess_setup_req *) sess_data->iov[0].iov_base; -- req->sync_hdr.SessionId = ses->Suid; -+ req->hdr.SessionId = cpu_to_le64(ses->Suid); - - rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length, ses, - sess_data->nls_cp); -@@ -1589,7 +1588,7 @@ SMB2_sess_auth_rawntlmssp_authenticate(struct SMB2_sess_data *sess_data) - - /* keep existing ses id and flags if binding */ - if (!ses->binding) { -- ses->Suid = rsp->sync_hdr.SessionId; -+ ses->Suid = le64_to_cpu(rsp->hdr.SessionId); - ses->session_flags = le16_to_cpu(rsp->SessionFlags); - } - -@@ -1720,12 +1719,12 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) - return rc; - - /* since no tcon, smb2_init can not do this, so do here */ -- req->sync_hdr.SessionId = ses->Suid; -+ req->hdr.SessionId = cpu_to_le64(ses->Suid); - - if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) - flags |= CIFS_TRANSFORM_REQ; - else if (server->sign) -- req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; -+ req->hdr.Flags |= SMB2_FLAGS_SIGNED; - - flags |= CIFS_NO_RSP_BUF; - -@@ -1833,14 +1832,14 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, - !(ses->session_flags & - (SMB2_SESSION_FLAG_IS_GUEST|SMB2_SESSION_FLAG_IS_NULL)) && - ((ses->user_name != NULL) || (ses->sectype == Kerberos))) -- req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; -+ req->hdr.Flags |= SMB2_FLAGS_SIGNED; - - memset(&rqst, 0, sizeof(struct smb_rqst)); - rqst.rq_iov = iov; - rqst.rq_nvec = 2; - - /* Need 64 for max size write so ask for more in case not there yet */ -- req->sync_hdr.CreditRequest = cpu_to_le16(64); -+ req->hdr.CreditRequest = cpu_to_le16(64); - - rc = cifs_send_recv(xid, ses, server, - &rqst, &resp_buftype, flags, &rsp_iov); -@@ -1876,7 +1875,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, - tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess); - tcon->tidStatus = CifsGood; - tcon->need_reconnect = false; -- tcon->tid = rsp->sync_hdr.TreeId; -+ tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId); - strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); - - if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && -@@ -1897,9 +1896,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, - return rc; - - tcon_error_exit: -- if (rsp && rsp->sync_hdr.Status == STATUS_BAD_NETWORK_NAME) { -+ if (rsp && rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) - cifs_tcon_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); -- } - goto tcon_exit; - } - -@@ -2614,7 +2612,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode, - if (tcon->share_flags & SHI1005_FLAGS_DFS) { - int name_len; - -- req->sync_hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; -+ req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; - rc = alloc_path_with_tree_prefix(©_path, ©_size, - &name_len, - tcon->treeName, utf16_path); -@@ -2746,7 +2744,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, - if (tcon->share_flags & SHI1005_FLAGS_DFS) { - int name_len; - -- req->sync_hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; -+ req->hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS; - rc = alloc_path_with_tree_prefix(©_path, ©_size, - &name_len, - tcon->treeName, path); -@@ -2958,7 +2956,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, - oparms->fid->volatile_fid = rsp->VolatileFileId; - oparms->fid->access = oparms->desired_access; - #ifdef CONFIG_CIFS_DEBUG2 -- oparms->fid->mid = le64_to_cpu(rsp->sync_hdr.MessageId); -+ oparms->fid->mid = le64_to_cpu(rsp->hdr.MessageId); - #endif /* CIFS_DEBUG2 */ - - if (buf) { -@@ -3058,7 +3056,7 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, - * response size smaller. - */ - req->MaxOutputResponse = cpu_to_le32(max_response_size); -- req->sync_hdr.CreditCharge = -+ req->hdr.CreditCharge = - cpu_to_le16(DIV_ROUND_UP(max(indatalen, max_response_size), - SMB2_MAX_BUFFER_SIZE)); - if (is_fsctl) -@@ -3068,7 +3066,7 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, - - /* validate negotiate request must be signed - see MS-SMB2 3.2.5.5 */ - if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO) -- req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED; -+ req->hdr.Flags |= SMB2_FLAGS_SIGNED; - - return 0; - } -@@ -3693,7 +3691,7 @@ smb2_echo_callback(struct mid_q_entry *mid) - - if (mid->mid_state == MID_RESPONSE_RECEIVED - || mid->mid_state == MID_RESPONSE_MALFORMED) { -- credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest); -+ credits.value = le16_to_cpu(rsp->hdr.CreditRequest); - credits.instance = server->reconnect_instance; - } - -@@ -3793,7 +3791,7 @@ SMB2_echo(struct TCP_Server_Info *server) - if (rc) - return rc; - -- req->sync_hdr.CreditRequest = cpu_to_le16(1); -+ req->hdr.CreditRequest = cpu_to_le16(1); - - iov[0].iov_len = total_len; - iov[0].iov_base = (char *)req; -@@ -3897,7 +3895,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len, - { - int rc = -EACCES; - struct smb2_read_plain_req *req = NULL; -- struct smb2_sync_hdr *shdr; -+ struct smb2_hdr *shdr; - struct TCP_Server_Info *server = io_parms->server; - - rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, server, -@@ -3908,8 +3906,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len, - if (server == NULL) - return -ECONNABORTED; - -- shdr = &req->sync_hdr; -- shdr->ProcessId = cpu_to_le32(io_parms->pid); -+ shdr = &req->hdr; -+ shdr->Id.SyncId.ProcessId = cpu_to_le32(io_parms->pid); - - req->PersistentFileId = io_parms->persistent_fid; - req->VolatileFileId = io_parms->volatile_fid; -@@ -3970,8 +3968,8 @@ smb2_new_read_req(void **buf, unsigned int *total_len, - * Related requests use info from previous read request - * in chain. - */ -- shdr->SessionId = 0xFFFFFFFFFFFFFFFF; -- shdr->TreeId = 0xFFFFFFFF; -+ shdr->SessionId = cpu_to_le64(0xFFFFFFFFFFFFFFFF); -+ shdr->Id.SyncId.TreeId = cpu_to_le32(0xFFFFFFFF); - req->PersistentFileId = 0xFFFFFFFFFFFFFFFF; - req->VolatileFileId = 0xFFFFFFFFFFFFFFFF; - } -@@ -3991,8 +3989,8 @@ smb2_readv_callback(struct mid_q_entry *mid) - struct cifs_readdata *rdata = mid->callback_data; - struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink); - struct TCP_Server_Info *server = rdata->server; -- struct smb2_sync_hdr *shdr = -- (struct smb2_sync_hdr *)rdata->iov[0].iov_base; -+ struct smb2_hdr *shdr = -+ (struct smb2_hdr *)rdata->iov[0].iov_base; - struct cifs_credits credits = { .value = 0, .instance = 0 }; - struct smb_rqst rqst = { .rq_iov = &rdata->iov[1], - .rq_nvec = 1, -@@ -4078,7 +4076,7 @@ smb2_async_readv(struct cifs_readdata *rdata) - { - int rc, flags = 0; - char *buf; -- struct smb2_sync_hdr *shdr; -+ struct smb2_hdr *shdr; - struct cifs_io_parms io_parms; - struct smb_rqst rqst = { .rq_iov = rdata->iov, - .rq_nvec = 1 }; -@@ -4111,7 +4109,7 @@ smb2_async_readv(struct cifs_readdata *rdata) - rdata->iov[0].iov_base = buf; - rdata->iov[0].iov_len = total_len; - -- shdr = (struct smb2_sync_hdr *)buf; -+ shdr = (struct smb2_hdr *)buf; - - if (rdata->credits.value > 0) { - shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(rdata->bytes, -@@ -4244,7 +4242,7 @@ smb2_writev_callback(struct mid_q_entry *mid) - - switch (mid->mid_state) { - case MID_RESPONSE_RECEIVED: -- credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest); -+ credits.value = le16_to_cpu(rsp->hdr.CreditRequest); - credits.instance = server->reconnect_instance; - wdata->result = smb2_check_receive(mid, server, 0); - if (wdata->result != 0) -@@ -4270,7 +4268,7 @@ smb2_writev_callback(struct mid_q_entry *mid) - wdata->result = -EAGAIN; - break; - case MID_RESPONSE_MALFORMED: -- credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest); -+ credits.value = le16_to_cpu(rsp->hdr.CreditRequest); - credits.instance = server->reconnect_instance; - fallthrough; - default: -@@ -4317,7 +4315,7 @@ smb2_async_writev(struct cifs_writedata *wdata, - { - int rc = -EACCES, flags = 0; - struct smb2_write_req *req = NULL; -- struct smb2_sync_hdr *shdr; -+ struct smb2_hdr *shdr; - struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink); - struct TCP_Server_Info *server = wdata->server; - struct kvec iov[1]; -@@ -4335,8 +4333,8 @@ smb2_async_writev(struct cifs_writedata *wdata, - if (smb3_encryption_required(tcon)) - flags |= CIFS_TRANSFORM_REQ; - -- shdr = (struct smb2_sync_hdr *)req; -- shdr->ProcessId = cpu_to_le32(wdata->cfile->pid); -+ shdr = (struct smb2_hdr *)req; -+ shdr->Id.SyncId.ProcessId = cpu_to_le32(wdata->cfile->pid); - - req->PersistentFileId = wdata->cfile->fid.persistent_fid; - req->VolatileFileId = wdata->cfile->fid.volatile_fid; -@@ -4487,7 +4485,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, - if (smb3_encryption_required(io_parms->tcon)) - flags |= CIFS_TRANSFORM_REQ; - -- req->sync_hdr.ProcessId = cpu_to_le32(io_parms->pid); -+ req->hdr.Id.SyncId.ProcessId = cpu_to_le32(io_parms->pid); - - req->PersistentFileId = io_parms->persistent_fid; - req->VolatileFileId = io_parms->volatile_fid; -@@ -4872,7 +4870,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, - - if (rc) { - if (rc == -ENODATA && -- rsp->sync_hdr.Status == STATUS_NO_MORE_FILES) { -+ rsp->hdr.Status == STATUS_NO_MORE_FILES) { - trace_smb3_query_dir_done(xid, persistent_fid, - tcon->tid, tcon->ses->Suid, index, 0); - srch_inf->endOfSearch = true; -@@ -4920,7 +4918,7 @@ SMB2_set_info_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, - if (rc) - return rc; - -- req->sync_hdr.ProcessId = cpu_to_le32(pid); -+ req->hdr.Id.SyncId.ProcessId = cpu_to_le32(pid); - req->InfoType = info_type; - req->FileInfoClass = info_class; - req->PersistentFileId = persistent_fid; -@@ -5080,7 +5078,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, - req->VolatileFid = volatile_fid; - req->PersistentFid = persistent_fid; - req->OplockLevel = oplock_level; -- req->sync_hdr.CreditRequest = cpu_to_le16(1); -+ req->hdr.CreditRequest = cpu_to_le16(1); - - flags |= CIFS_NO_RSP_BUF; - -@@ -5382,7 +5380,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, - if (smb3_encryption_required(tcon)) - flags |= CIFS_TRANSFORM_REQ; - -- req->sync_hdr.ProcessId = cpu_to_le32(pid); -+ req->hdr.Id.SyncId.ProcessId = cpu_to_le32(pid); - req->LockCount = cpu_to_le16(num_lock); - - req->PersistentFileId = persist_fid; -@@ -5458,7 +5456,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, - if (smb3_encryption_required(tcon)) - flags |= CIFS_TRANSFORM_REQ; - -- req->sync_hdr.CreditRequest = cpu_to_le16(1); -+ req->hdr.CreditRequest = cpu_to_le16(1); - req->StructureSize = cpu_to_le16(36); - total_len += 12; - -diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h -index f32c99c9ba13..739e98d117ed 100644 ---- a/fs/cifs/smb2pdu.h -+++ b/fs/cifs/smb2pdu.h -@@ -14,156 +14,12 @@ - #include - #include "cifsacl.h" - --/* -- * Note that, due to trying to use names similar to the protocol specifications, -- * there are many mixed case field names in the structures below. Although -- * this does not match typical Linux kernel style, it is necessary to be -- * able to match against the protocol specfication. -- * -- * SMB2 commands -- * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses -- * (ie no useful data other than the SMB error code itself) and are marked such. -- * Knowing this helps avoid response buffer allocations and copy in some cases. -- */ -- --/* List of commands in host endian */ --#define SMB2_NEGOTIATE_HE 0x0000 --#define SMB2_SESSION_SETUP_HE 0x0001 --#define SMB2_LOGOFF_HE 0x0002 /* trivial request/resp */ --#define SMB2_TREE_CONNECT_HE 0x0003 --#define SMB2_TREE_DISCONNECT_HE 0x0004 /* trivial req/resp */ --#define SMB2_CREATE_HE 0x0005 --#define SMB2_CLOSE_HE 0x0006 --#define SMB2_FLUSH_HE 0x0007 /* trivial resp */ --#define SMB2_READ_HE 0x0008 --#define SMB2_WRITE_HE 0x0009 --#define SMB2_LOCK_HE 0x000A --#define SMB2_IOCTL_HE 0x000B --#define SMB2_CANCEL_HE 0x000C --#define SMB2_ECHO_HE 0x000D --#define SMB2_QUERY_DIRECTORY_HE 0x000E --#define SMB2_CHANGE_NOTIFY_HE 0x000F --#define SMB2_QUERY_INFO_HE 0x0010 --#define SMB2_SET_INFO_HE 0x0011 --#define SMB2_OPLOCK_BREAK_HE 0x0012 -- --/* The same list in little endian */ --#define SMB2_NEGOTIATE cpu_to_le16(SMB2_NEGOTIATE_HE) --#define SMB2_SESSION_SETUP cpu_to_le16(SMB2_SESSION_SETUP_HE) --#define SMB2_LOGOFF cpu_to_le16(SMB2_LOGOFF_HE) --#define SMB2_TREE_CONNECT cpu_to_le16(SMB2_TREE_CONNECT_HE) --#define SMB2_TREE_DISCONNECT cpu_to_le16(SMB2_TREE_DISCONNECT_HE) --#define SMB2_CREATE cpu_to_le16(SMB2_CREATE_HE) --#define SMB2_CLOSE cpu_to_le16(SMB2_CLOSE_HE) --#define SMB2_FLUSH cpu_to_le16(SMB2_FLUSH_HE) --#define SMB2_READ cpu_to_le16(SMB2_READ_HE) --#define SMB2_WRITE cpu_to_le16(SMB2_WRITE_HE) --#define SMB2_LOCK cpu_to_le16(SMB2_LOCK_HE) --#define SMB2_IOCTL cpu_to_le16(SMB2_IOCTL_HE) --#define SMB2_CANCEL cpu_to_le16(SMB2_CANCEL_HE) --#define SMB2_ECHO cpu_to_le16(SMB2_ECHO_HE) --#define SMB2_QUERY_DIRECTORY cpu_to_le16(SMB2_QUERY_DIRECTORY_HE) --#define SMB2_CHANGE_NOTIFY cpu_to_le16(SMB2_CHANGE_NOTIFY_HE) --#define SMB2_QUERY_INFO cpu_to_le16(SMB2_QUERY_INFO_HE) --#define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE) --#define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE) -- --#define SMB2_INTERNAL_CMD cpu_to_le16(0xFFFF) -- --#define NUMBER_OF_SMB2_COMMANDS 0x0013 -- - /* 52 transform hdr + 64 hdr + 88 create rsp */ - #define SMB2_TRANSFORM_HEADER_SIZE 52 - #define MAX_SMB2_HDR_SIZE 204 - --#define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe) --#define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd) --#define SMB2_COMPRESSION_TRANSFORM_ID cpu_to_le32(0x424d53fc) -- --/* -- * SMB2 Header Definition -- * -- * "MBZ" : Must be Zero -- * "BB" : BugBug, Something to check/review/analyze later -- * "PDU" : "Protocol Data Unit" (ie a network "frame") -- * -- */ -- --#define SMB2_HEADER_STRUCTURE_SIZE cpu_to_le16(64) -- --struct smb2_sync_hdr { -- __le32 ProtocolId; /* 0xFE 'S' 'M' 'B' */ -- __le16 StructureSize; /* 64 */ -- __le16 CreditCharge; /* MBZ */ -- __le32 Status; /* Error from server */ -- __le16 Command; -- __le16 CreditRequest; /* CreditResponse */ -- __le32 Flags; -- __le32 NextCommand; -- __le64 MessageId; -- __le32 ProcessId; -- __u32 TreeId; /* opaque - so do not make little endian */ -- __u64 SessionId; /* opaque - so do not make little endian */ -- __u8 Signature[16]; --} __packed; -- - /* The total header size for SMB2 read and write */ --#define SMB2_READWRITE_PDU_HEADER_SIZE (48 + sizeof(struct smb2_sync_hdr)) -- --struct smb2_sync_pdu { -- struct smb2_sync_hdr sync_hdr; -- __le16 StructureSize2; /* size of wct area (varies, request specific) */ --} __packed; -- --#define SMB3_AES_CCM_NONCE 11 --#define SMB3_AES_GCM_NONCE 12 -- --/* Transform flags (for 3.0 dialect this flag indicates CCM */ --#define TRANSFORM_FLAG_ENCRYPTED 0x0001 --struct smb2_transform_hdr { -- __le32 ProtocolId; /* 0xFD 'S' 'M' 'B' */ -- __u8 Signature[16]; -- __u8 Nonce[16]; -- __le32 OriginalMessageSize; -- __u16 Reserved1; -- __le16 Flags; /* EncryptionAlgorithm for 3.0, enc enabled for 3.1.1 */ -- __u64 SessionId; --} __packed; -- --/* See MS-SMB2 2.2.42 */ --struct smb2_compression_transform_hdr_unchained { -- __le32 ProtocolId; /* 0xFC 'S' 'M' 'B' */ -- __le32 OriginalCompressedSegmentSize; -- __le16 CompressionAlgorithm; -- __le16 Flags; -- __le16 Length; /* if chained it is length, else offset */ --} __packed; -- --/* See MS-SMB2 2.2.42.1 */ --#define SMB2_COMPRESSION_FLAG_NONE 0x0000 --#define SMB2_COMPRESSION_FLAG_CHAINED 0x0001 -- --struct compression_payload_header { -- __le16 CompressionAlgorithm; -- __le16 Flags; -- __le32 Length; /* length of compressed playload including field below if present */ -- /* __le32 OriginalPayloadSize; */ /* optional, present when LZNT1, LZ77, LZ77+Huffman */ --} __packed; -- --/* See MS-SMB2 2.2.42.2 */ --struct smb2_compression_transform_hdr_chained { -- __le32 ProtocolId; /* 0xFC 'S' 'M' 'B' */ -- __le32 OriginalCompressedSegmentSize; -- /* struct compression_payload_header[] */ --} __packed; -- --/* See MS-SMB2 2.2.42.2.2 */ --struct compression_pattern_payload_v1 { -- __le16 Pattern; -- __le16 Reserved1; -- __le16 Reserved2; -- __le32 Repetitions; --} __packed; -+#define SMB2_READWRITE_PDU_HEADER_SIZE (48 + sizeof(struct smb2_hdr)) - - /* See MS-SMB2 2.2.43 */ - struct smb2_rdma_transform { -@@ -189,17 +45,6 @@ struct smb2_rdma_crypto_transform { - /* followed by padding */ - } __packed; - --/* -- * SMB2 flag definitions -- */ --#define SMB2_FLAGS_SERVER_TO_REDIR cpu_to_le32(0x00000001) --#define SMB2_FLAGS_ASYNC_COMMAND cpu_to_le32(0x00000002) --#define SMB2_FLAGS_RELATED_OPERATIONS cpu_to_le32(0x00000004) --#define SMB2_FLAGS_SIGNED cpu_to_le32(0x00000008) --#define SMB2_FLAGS_PRIORITY_MASK cpu_to_le32(0x00000070) /* SMB3.1.1 */ --#define SMB2_FLAGS_DFS_OPERATIONS cpu_to_le32(0x10000000) --#define SMB2_FLAGS_REPLAY_OPERATION cpu_to_le32(0x20000000) /* SMB3 & up */ -- - /* - * Definitions for SMB2 Protocol Data Units (network frames) - * -@@ -214,7 +59,7 @@ struct smb2_rdma_crypto_transform { - #define SMB2_ERROR_STRUCTURE_SIZE2 cpu_to_le16(9) - - struct smb2_err_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; - __le16 Reserved; /* MBZ */ - __le32 ByteCount; /* even if zero, at least one byte follows */ -@@ -273,7 +118,7 @@ struct share_redirect_error_context_rsp { - #define SMB2_CLIENT_GUID_SIZE 16 - - struct smb2_negotiate_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 36 */ - __le16 DialectCount; - __le16 SecurityMode; -@@ -472,7 +317,7 @@ struct smb2_posix_neg_context { - } __packed; - - struct smb2_negotiate_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 65 */ - __le16 SecurityMode; - __le16 DialectRevision; -@@ -495,7 +340,7 @@ struct smb2_negotiate_rsp { - #define SMB2_SESSION_REQ_FLAG_ENCRYPT_DATA 0x04 - - struct smb2_sess_setup_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 25 */ - __u8 Flags; - __u8 SecurityMode; -@@ -512,7 +357,7 @@ struct smb2_sess_setup_req { - #define SMB2_SESSION_FLAG_IS_NULL 0x0002 - #define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004 - struct smb2_sess_setup_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 9 */ - __le16 SessionFlags; - __le16 SecurityBufferOffset; -@@ -521,161 +366,13 @@ struct smb2_sess_setup_rsp { - } __packed; - - struct smb2_logoff_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 4 */ - __le16 Reserved; - } __packed; - - struct smb2_logoff_rsp { -- struct smb2_sync_hdr sync_hdr; -- __le16 StructureSize; /* Must be 4 */ -- __le16 Reserved; --} __packed; -- --/* Flags/Reserved for SMB3.1.1 */ --#define SMB2_TREE_CONNECT_FLAG_CLUSTER_RECONNECT cpu_to_le16(0x0001) --#define SMB2_TREE_CONNECT_FLAG_REDIRECT_TO_OWNER cpu_to_le16(0x0002) --#define SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT cpu_to_le16(0x0004) -- --struct smb2_tree_connect_req { -- struct smb2_sync_hdr sync_hdr; -- __le16 StructureSize; /* Must be 9 */ -- __le16 Flags; /* Reserved MBZ for dialects prior to SMB3.1.1 */ -- __le16 PathOffset; -- __le16 PathLength; -- __u8 Buffer[1]; /* variable length */ --} __packed; -- --/* See MS-SMB2 section 2.2.9.2 */ --/* Context Types */ --#define SMB2_RESERVED_TREE_CONNECT_CONTEXT_ID 0x0000 --#define SMB2_REMOTED_IDENTITY_TREE_CONNECT_CONTEXT_ID cpu_to_le16(0x0001) -- --struct tree_connect_contexts { -- __le16 ContextType; -- __le16 DataLength; -- __le32 Reserved; -- __u8 Data[]; --} __packed; -- --/* Remoted identity tree connect context structures - see MS-SMB2 2.2.9.2.1 */ --struct smb3_blob_data { -- __le16 BlobSize; -- __u8 BlobData[]; --} __packed; -- --/* Valid values for Attr */ --#define SE_GROUP_MANDATORY 0x00000001 --#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 --#define SE_GROUP_ENABLED 0x00000004 --#define SE_GROUP_OWNER 0x00000008 --#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 --#define SE_GROUP_INTEGRITY 0x00000020 --#define SE_GROUP_INTEGRITY_ENABLED 0x00000040 --#define SE_GROUP_RESOURCE 0x20000000 --#define SE_GROUP_LOGON_ID 0xC0000000 -- --/* struct sid_attr_data is SidData array in BlobData format then le32 Attr */ -- --struct sid_array_data { -- __le16 SidAttrCount; -- /* SidAttrList - array of sid_attr_data structs */ --} __packed; -- --struct luid_attr_data { -- --} __packed; -- --/* -- * struct privilege_data is the same as BLOB_DATA - see MS-SMB2 2.2.9.2.1.5 -- * but with size of LUID_ATTR_DATA struct and BlobData set to LUID_ATTR DATA -- */ -- --struct privilege_array_data { -- __le16 PrivilegeCount; -- /* array of privilege_data structs */ --} __packed; -- --struct remoted_identity_tcon_context { -- __le16 TicketType; /* must be 0x0001 */ -- __le16 TicketSize; /* total size of this struct */ -- __le16 User; /* offset to SID_ATTR_DATA struct with user info */ -- __le16 UserName; /* offset to null terminated Unicode username string */ -- __le16 Domain; /* offset to null terminated Unicode domain name */ -- __le16 Groups; /* offset to SID_ARRAY_DATA struct with group info */ -- __le16 RestrictedGroups; /* similar to above */ -- __le16 Privileges; /* offset to PRIVILEGE_ARRAY_DATA struct */ -- __le16 PrimaryGroup; /* offset to SID_ARRAY_DATA struct */ -- __le16 Owner; /* offset to BLOB_DATA struct */ -- __le16 DefaultDacl; /* offset to BLOB_DATA struct */ -- __le16 DeviceGroups; /* offset to SID_ARRAY_DATA struct */ -- __le16 UserClaims; /* offset to BLOB_DATA struct */ -- __le16 DeviceClaims; /* offset to BLOB_DATA struct */ -- __u8 TicketInfo[]; /* variable length buf - remoted identity data */ --} __packed; -- --struct smb2_tree_connect_req_extension { -- __le32 TreeConnectContextOffset; -- __le16 TreeConnectContextCount; -- __u8 Reserved[10]; -- __u8 PathName[]; /* variable sized array */ -- /* followed by array of TreeConnectContexts */ --} __packed; -- --struct smb2_tree_connect_rsp { -- struct smb2_sync_hdr sync_hdr; -- __le16 StructureSize; /* Must be 16 */ -- __u8 ShareType; /* see below */ -- __u8 Reserved; -- __le32 ShareFlags; /* see below */ -- __le32 Capabilities; /* see below */ -- __le32 MaximalAccess; --} __packed; -- --/* Possible ShareType values */ --#define SMB2_SHARE_TYPE_DISK 0x01 --#define SMB2_SHARE_TYPE_PIPE 0x02 --#define SMB2_SHARE_TYPE_PRINT 0x03 -- --/* -- * Possible ShareFlags - exactly one and only one of the first 4 caching flags -- * must be set (any of the remaining, SHI1005, flags may be set individually -- * or in combination. -- */ --#define SMB2_SHAREFLAG_MANUAL_CACHING 0x00000000 --#define SMB2_SHAREFLAG_AUTO_CACHING 0x00000010 --#define SMB2_SHAREFLAG_VDO_CACHING 0x00000020 --#define SMB2_SHAREFLAG_NO_CACHING 0x00000030 --#define SHI1005_FLAGS_DFS 0x00000001 --#define SHI1005_FLAGS_DFS_ROOT 0x00000002 --#define SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS 0x00000100 --#define SHI1005_FLAGS_FORCE_SHARED_DELETE 0x00000200 --#define SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING 0x00000400 --#define SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM 0x00000800 --#define SHI1005_FLAGS_FORCE_LEVELII_OPLOCK 0x00001000 --#define SHI1005_FLAGS_ENABLE_HASH_V1 0x00002000 --#define SHI1005_FLAGS_ENABLE_HASH_V2 0x00004000 --#define SHI1005_FLAGS_ENCRYPT_DATA 0x00008000 --#define SMB2_SHAREFLAG_IDENTITY_REMOTING 0x00040000 /* 3.1.1 */ --#define SMB2_SHAREFLAG_COMPRESS_DATA 0x00100000 /* 3.1.1 */ --#define SHI1005_FLAGS_ALL 0x0014FF33 -- --/* Possible share capabilities */ --#define SMB2_SHARE_CAP_DFS cpu_to_le32(0x00000008) /* all dialects */ --#define SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY cpu_to_le32(0x00000010) /* 3.0 */ --#define SMB2_SHARE_CAP_SCALEOUT cpu_to_le32(0x00000020) /* 3.0 */ --#define SMB2_SHARE_CAP_CLUSTER cpu_to_le32(0x00000040) /* 3.0 */ --#define SMB2_SHARE_CAP_ASYMMETRIC cpu_to_le32(0x00000080) /* 3.02 */ --#define SMB2_SHARE_CAP_REDIRECT_TO_OWNER cpu_to_le32(0x00000100) /* 3.1.1 */ -- --struct smb2_tree_disconnect_req { -- struct smb2_sync_hdr sync_hdr; -- __le16 StructureSize; /* Must be 4 */ -- __le16 Reserved; --} __packed; -- --struct smb2_tree_disconnect_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 4 */ - __le16 Reserved; - } __packed; -@@ -808,7 +505,7 @@ struct smb2_tree_disconnect_rsp { - #define SMB2_CREATE_IOV_SIZE 8 - - struct smb2_create_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 57 */ - __u8 SecurityFlags; - __u8 RequestedOplockLevel; -@@ -835,7 +532,7 @@ struct smb2_create_req { - #define MAX_SMB2_CREATE_RESPONSE_SIZE 880 - - struct smb2_create_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 89 */ - __u8 OplockLevel; - __u8 Flag; /* 0x01 if reparse point */ -@@ -1210,7 +907,7 @@ struct duplicate_extents_to_file { - #define SMB2_IOCTL_IOV_SIZE 2 - - struct smb2_ioctl_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 57 */ - __u16 Reserved; - __le32 CtlCode; -@@ -1228,7 +925,7 @@ struct smb2_ioctl_req { - } __packed; - - struct smb2_ioctl_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 57 */ - __u16 Reserved; - __le32 CtlCode; -@@ -1246,7 +943,7 @@ struct smb2_ioctl_rsp { - /* Currently defined values for close flags */ - #define SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB cpu_to_le16(0x0001) - struct smb2_close_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 24 */ - __le16 Flags; - __le32 Reserved; -@@ -1260,7 +957,7 @@ struct smb2_close_req { - #define MAX_SMB2_CLOSE_RESPONSE_SIZE 124 - - struct smb2_close_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* 60 */ - __le16 Flags; - __le32 Reserved; -@@ -1274,7 +971,7 @@ struct smb2_close_rsp { - } __packed; - - struct smb2_flush_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 24 */ - __le16 Reserved1; - __le32 Reserved2; -@@ -1283,7 +980,7 @@ struct smb2_flush_req { - } __packed; - - struct smb2_flush_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; - __le16 Reserved; - } __packed; -@@ -1300,7 +997,7 @@ struct smb2_flush_rsp { - - /* SMB2 read request without RFC1001 length at the beginning */ - struct smb2_read_plain_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 49 */ - __u8 Padding; /* offset from start of SMB2 header to place read */ - __u8 Flags; /* MBZ unless SMB3.02 or later */ -@@ -1321,7 +1018,7 @@ struct smb2_read_plain_req { - #define SMB2_READFLAG_RESPONSE_RDMA_TRANSFORM 0x00000001 - - struct smb2_read_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 17 */ - __u8 DataOffset; - __u8 Reserved; -@@ -1336,7 +1033,7 @@ struct smb2_read_rsp { - #define SMB2_WRITEFLAG_WRITE_UNBUFFERED 0x00000002 /* SMB3.02 or later */ - - struct smb2_write_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 49 */ - __le16 DataOffset; /* offset from start of SMB2 header to write data */ - __le32 Length; -@@ -1352,7 +1049,7 @@ struct smb2_write_req { - } __packed; - - struct smb2_write_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 17 */ - __u8 DataOffset; - __u8 Reserved; -@@ -1380,7 +1077,7 @@ struct smb2_write_rsp { - #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 - - struct smb2_change_notify_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; - __le16 Flags; - __le32 OutputBufferLength; -@@ -1391,7 +1088,7 @@ struct smb2_change_notify_req { - } __packed; - - struct smb2_change_notify_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 9 */ - __le16 OutputBufferOffset; - __le32 OutputBufferLength; -@@ -1411,7 +1108,7 @@ struct smb2_lock_element { - } __packed; - - struct smb2_lock_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 48 */ - __le16 LockCount; - /* -@@ -1426,19 +1123,19 @@ struct smb2_lock_req { - } __packed; - - struct smb2_lock_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 4 */ - __le16 Reserved; - } __packed; - - struct smb2_echo_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 4 */ - __u16 Reserved; - } __packed; - - struct smb2_echo_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 4 */ - __u16 Reserved; - } __packed; -@@ -1468,7 +1165,7 @@ struct smb2_echo_rsp { - */ - - struct smb2_query_directory_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 33 */ - __u8 FileInformationClass; - __u8 Flags; -@@ -1482,7 +1179,7 @@ struct smb2_query_directory_req { - } __packed; - - struct smb2_query_directory_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 9 */ - __le16 OutputBufferOffset; - __le32 OutputBufferLength; -@@ -1515,7 +1212,7 @@ struct smb2_query_directory_rsp { - #define SL_INDEX_SPECIFIED 0x00000004 - - struct smb2_query_info_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 41 */ - __u8 InfoType; - __u8 FileInfoClass; -@@ -1531,7 +1228,7 @@ struct smb2_query_info_req { - } __packed; - - struct smb2_query_info_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 9 */ - __le16 OutputBufferOffset; - __le32 OutputBufferLength; -@@ -1548,7 +1245,7 @@ struct smb2_query_info_rsp { - #define SMB2_SET_INFO_IOV_SIZE 3 - - struct smb2_set_info_req { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 33 */ - __u8 InfoType; - __u8 FileInfoClass; -@@ -1562,12 +1259,12 @@ struct smb2_set_info_req { - } __packed; - - struct smb2_set_info_rsp { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 2 */ - } __packed; - - struct smb2_oplock_break { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 24 */ - __u8 OplockLevel; - __u8 Reserved; -@@ -1579,7 +1276,7 @@ struct smb2_oplock_break { - #define SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED cpu_to_le32(0x01) - - struct smb2_lease_break { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 44 */ - __le16 Epoch; - __le32 Flags; -@@ -1592,7 +1289,7 @@ struct smb2_lease_break { - } __packed; - - struct smb2_lease_ack { -- struct smb2_sync_hdr sync_hdr; -+ struct smb2_hdr hdr; - __le16 StructureSize; /* Must be 36 */ - __le16 Reserved; - __le32 Flags; -diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h -index 547945443fa7..096fada16ebd 100644 ---- a/fs/cifs/smb2proto.h -+++ b/fs/cifs/smb2proto.h -@@ -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); - -diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c -index f59b956f9d25..2bf047b390a9 100644 ---- a/fs/cifs/smb2transport.c -+++ b/fs/cifs/smb2transport.c -@@ -19,7 +19,6 @@ - #include - #include - #include --#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 && -diff --git a/fs/smbfs_common/smb2pdu.h b/fs/smbfs_common/smb2pdu.h -new file mode 100644 -index 000000000000..f191ed64c1ee ---- /dev/null -+++ b/fs/smbfs_common/smb2pdu.h -@@ -0,0 +1,318 @@ -+/* SPDX-License-Identifier: LGPL-2.1 */ -+#ifndef _COMMON_SMB2PDU_H -+#define _COMMON_SMB2PDU_H -+ -+/* -+ * Note that, due to trying to use names similar to the protocol specifications, -+ * there are many mixed case field names in the structures below. Although -+ * this does not match typical Linux kernel style, it is necessary to be -+ * able to match against the protocol specfication. -+ * -+ * SMB2 commands -+ * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses -+ * (ie no useful data other than the SMB error code itself) and are marked such. -+ * Knowing this helps avoid response buffer allocations and copy in some cases. -+ */ -+ -+/* List of commands in host endian */ -+#define SMB2_NEGOTIATE_HE 0x0000 -+#define SMB2_SESSION_SETUP_HE 0x0001 -+#define SMB2_LOGOFF_HE 0x0002 /* trivial request/resp */ -+#define SMB2_TREE_CONNECT_HE 0x0003 -+#define SMB2_TREE_DISCONNECT_HE 0x0004 /* trivial req/resp */ -+#define SMB2_CREATE_HE 0x0005 -+#define SMB2_CLOSE_HE 0x0006 -+#define SMB2_FLUSH_HE 0x0007 /* trivial resp */ -+#define SMB2_READ_HE 0x0008 -+#define SMB2_WRITE_HE 0x0009 -+#define SMB2_LOCK_HE 0x000A -+#define SMB2_IOCTL_HE 0x000B -+#define SMB2_CANCEL_HE 0x000C -+#define SMB2_ECHO_HE 0x000D -+#define SMB2_QUERY_DIRECTORY_HE 0x000E -+#define SMB2_CHANGE_NOTIFY_HE 0x000F -+#define SMB2_QUERY_INFO_HE 0x0010 -+#define SMB2_SET_INFO_HE 0x0011 -+#define SMB2_OPLOCK_BREAK_HE 0x0012 -+ -+/* The same list in little endian */ -+#define SMB2_NEGOTIATE cpu_to_le16(SMB2_NEGOTIATE_HE) -+#define SMB2_SESSION_SETUP cpu_to_le16(SMB2_SESSION_SETUP_HE) -+#define SMB2_LOGOFF cpu_to_le16(SMB2_LOGOFF_HE) -+#define SMB2_TREE_CONNECT cpu_to_le16(SMB2_TREE_CONNECT_HE) -+#define SMB2_TREE_DISCONNECT cpu_to_le16(SMB2_TREE_DISCONNECT_HE) -+#define SMB2_CREATE cpu_to_le16(SMB2_CREATE_HE) -+#define SMB2_CLOSE cpu_to_le16(SMB2_CLOSE_HE) -+#define SMB2_FLUSH cpu_to_le16(SMB2_FLUSH_HE) -+#define SMB2_READ cpu_to_le16(SMB2_READ_HE) -+#define SMB2_WRITE cpu_to_le16(SMB2_WRITE_HE) -+#define SMB2_LOCK cpu_to_le16(SMB2_LOCK_HE) -+#define SMB2_IOCTL cpu_to_le16(SMB2_IOCTL_HE) -+#define SMB2_CANCEL cpu_to_le16(SMB2_CANCEL_HE) -+#define SMB2_ECHO cpu_to_le16(SMB2_ECHO_HE) -+#define SMB2_QUERY_DIRECTORY cpu_to_le16(SMB2_QUERY_DIRECTORY_HE) -+#define SMB2_CHANGE_NOTIFY cpu_to_le16(SMB2_CHANGE_NOTIFY_HE) -+#define SMB2_QUERY_INFO cpu_to_le16(SMB2_QUERY_INFO_HE) -+#define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE) -+#define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE) -+ -+#define SMB2_INTERNAL_CMD cpu_to_le16(0xFFFF) -+ -+#define NUMBER_OF_SMB2_COMMANDS 0x0013 -+ -+/* -+ * SMB2 Header Definition -+ * -+ * "MBZ" : Must be Zero -+ * "BB" : BugBug, Something to check/review/analyze later -+ * "PDU" : "Protocol Data Unit" (ie a network "frame") -+ * -+ */ -+ -+#define __SMB2_HEADER_STRUCTURE_SIZE 64 -+#define SMB2_HEADER_STRUCTURE_SIZE \ -+ cpu_to_le16(__SMB2_HEADER_STRUCTURE_SIZE) -+ -+#define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe) -+#define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd) -+#define SMB2_COMPRESSION_TRANSFORM_ID cpu_to_le32(0x424d53fc) -+ -+/* -+ * SMB2 flag definitions -+ */ -+#define SMB2_FLAGS_SERVER_TO_REDIR cpu_to_le32(0x00000001) -+#define SMB2_FLAGS_ASYNC_COMMAND cpu_to_le32(0x00000002) -+#define SMB2_FLAGS_RELATED_OPERATIONS cpu_to_le32(0x00000004) -+#define SMB2_FLAGS_SIGNED cpu_to_le32(0x00000008) -+#define SMB2_FLAGS_PRIORITY_MASK cpu_to_le32(0x00000070) /* SMB3.1.1 */ -+#define SMB2_FLAGS_DFS_OPERATIONS cpu_to_le32(0x10000000) -+#define SMB2_FLAGS_REPLAY_OPERATION cpu_to_le32(0x20000000) /* SMB3 & up */ -+ -+/* See MS-SMB2 section 2.2.1 */ -+struct smb2_hdr { -+ __le32 ProtocolId; /* 0xFE 'S' 'M' 'B' */ -+ __le16 StructureSize; /* 64 */ -+ __le16 CreditCharge; /* MBZ */ -+ __le32 Status; /* Error from server */ -+ __le16 Command; -+ __le16 CreditRequest; /* CreditResponse */ -+ __le32 Flags; -+ __le32 NextCommand; -+ __le64 MessageId; -+ union { -+ struct { -+ __le32 ProcessId; -+ __le32 TreeId; -+ } __packed SyncId; -+ __le64 AsyncId; -+ } __packed Id; -+ __le64 SessionId; -+ __u8 Signature[16]; -+} __packed; -+ -+struct smb2_pdu { -+ struct smb2_hdr hdr; -+ __le16 StructureSize2; /* size of wct area (varies, request specific) */ -+} __packed; -+ -+#define SMB3_AES_CCM_NONCE 11 -+#define SMB3_AES_GCM_NONCE 12 -+ -+/* Transform flags (for 3.0 dialect this flag indicates CCM */ -+#define TRANSFORM_FLAG_ENCRYPTED 0x0001 -+struct smb2_transform_hdr { -+ __le32 ProtocolId; /* 0xFD 'S' 'M' 'B' */ -+ __u8 Signature[16]; -+ __u8 Nonce[16]; -+ __le32 OriginalMessageSize; -+ __u16 Reserved1; -+ __le16 Flags; /* EncryptionAlgorithm for 3.0, enc enabled for 3.1.1 */ -+ __le64 SessionId; -+} __packed; -+ -+ -+/* See MS-SMB2 2.2.42 */ -+struct smb2_compression_transform_hdr_unchained { -+ __le32 ProtocolId; /* 0xFC 'S' 'M' 'B' */ -+ __le32 OriginalCompressedSegmentSize; -+ __le16 CompressionAlgorithm; -+ __le16 Flags; -+ __le16 Length; /* if chained it is length, else offset */ -+} __packed; -+ -+/* See MS-SMB2 2.2.42.1 */ -+#define SMB2_COMPRESSION_FLAG_NONE 0x0000 -+#define SMB2_COMPRESSION_FLAG_CHAINED 0x0001 -+ -+struct compression_payload_header { -+ __le16 CompressionAlgorithm; -+ __le16 Flags; -+ __le32 Length; /* length of compressed playload including field below if present */ -+ /* __le32 OriginalPayloadSize; */ /* optional, present when LZNT1, LZ77, LZ77+Huffman */ -+} __packed; -+ -+/* See MS-SMB2 2.2.42.2 */ -+struct smb2_compression_transform_hdr_chained { -+ __le32 ProtocolId; /* 0xFC 'S' 'M' 'B' */ -+ __le32 OriginalCompressedSegmentSize; -+ /* struct compression_payload_header[] */ -+} __packed; -+ -+/* See MS-SMB2 2.2.42.2.2 */ -+struct compression_pattern_payload_v1 { -+ __le16 Pattern; -+ __le16 Reserved1; -+ __le16 Reserved2; -+ __le32 Repetitions; -+} __packed; -+ -+/* See MS-SMB2 section 2.2.9.2 */ -+/* Context Types */ -+#define SMB2_RESERVED_TREE_CONNECT_CONTEXT_ID 0x0000 -+#define SMB2_REMOTED_IDENTITY_TREE_CONNECT_CONTEXT_ID cpu_to_le16(0x0001) -+ -+struct tree_connect_contexts { -+ __le16 ContextType; -+ __le16 DataLength; -+ __le32 Reserved; -+ __u8 Data[]; -+} __packed; -+ -+/* Remoted identity tree connect context structures - see MS-SMB2 2.2.9.2.1 */ -+struct smb3_blob_data { -+ __le16 BlobSize; -+ __u8 BlobData[]; -+} __packed; -+ -+/* Valid values for Attr */ -+#define SE_GROUP_MANDATORY 0x00000001 -+#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 -+#define SE_GROUP_ENABLED 0x00000004 -+#define SE_GROUP_OWNER 0x00000008 -+#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 -+#define SE_GROUP_INTEGRITY 0x00000020 -+#define SE_GROUP_INTEGRITY_ENABLED 0x00000040 -+#define SE_GROUP_RESOURCE 0x20000000 -+#define SE_GROUP_LOGON_ID 0xC0000000 -+ -+/* struct sid_attr_data is SidData array in BlobData format then le32 Attr */ -+ -+struct sid_array_data { -+ __le16 SidAttrCount; -+ /* SidAttrList - array of sid_attr_data structs */ -+} __packed; -+ -+struct luid_attr_data { -+ -+} __packed; -+ -+/* -+ * struct privilege_data is the same as BLOB_DATA - see MS-SMB2 2.2.9.2.1.5 -+ * but with size of LUID_ATTR_DATA struct and BlobData set to LUID_ATTR DATA -+ */ -+ -+struct privilege_array_data { -+ __le16 PrivilegeCount; -+ /* array of privilege_data structs */ -+} __packed; -+ -+struct remoted_identity_tcon_context { -+ __le16 TicketType; /* must be 0x0001 */ -+ __le16 TicketSize; /* total size of this struct */ -+ __le16 User; /* offset to SID_ATTR_DATA struct with user info */ -+ __le16 UserName; /* offset to null terminated Unicode username string */ -+ __le16 Domain; /* offset to null terminated Unicode domain name */ -+ __le16 Groups; /* offset to SID_ARRAY_DATA struct with group info */ -+ __le16 RestrictedGroups; /* similar to above */ -+ __le16 Privileges; /* offset to PRIVILEGE_ARRAY_DATA struct */ -+ __le16 PrimaryGroup; /* offset to SID_ARRAY_DATA struct */ -+ __le16 Owner; /* offset to BLOB_DATA struct */ -+ __le16 DefaultDacl; /* offset to BLOB_DATA struct */ -+ __le16 DeviceGroups; /* offset to SID_ARRAY_DATA struct */ -+ __le16 UserClaims; /* offset to BLOB_DATA struct */ -+ __le16 DeviceClaims; /* offset to BLOB_DATA struct */ -+ __u8 TicketInfo[]; /* variable length buf - remoted identity data */ -+} __packed; -+ -+struct smb2_tree_connect_req_extension { -+ __le32 TreeConnectContextOffset; -+ __le16 TreeConnectContextCount; -+ __u8 Reserved[10]; -+ __u8 PathName[]; /* variable sized array */ -+ /* followed by array of TreeConnectContexts */ -+} __packed; -+ -+/* Flags/Reserved for SMB3.1.1 */ -+#define SMB2_TREE_CONNECT_FLAG_CLUSTER_RECONNECT cpu_to_le16(0x0001) -+#define SMB2_TREE_CONNECT_FLAG_REDIRECT_TO_OWNER cpu_to_le16(0x0002) -+#define SMB2_TREE_CONNECT_FLAG_EXTENSION_PRESENT cpu_to_le16(0x0004) -+ -+struct smb2_tree_connect_req { -+ struct smb2_hdr hdr; -+ __le16 StructureSize; /* Must be 9 */ -+ __le16 Flags; /* Flags in SMB3.1.1 */ -+ __le16 PathOffset; -+ __le16 PathLength; -+ __u8 Buffer[1]; /* variable length */ -+} __packed; -+ -+/* Possible ShareType values */ -+#define SMB2_SHARE_TYPE_DISK 0x01 -+#define SMB2_SHARE_TYPE_PIPE 0x02 -+#define SMB2_SHARE_TYPE_PRINT 0x03 -+ -+/* -+ * Possible ShareFlags - exactly one and only one of the first 4 caching flags -+ * must be set (any of the remaining, SHI1005, flags may be set individually -+ * or in combination. -+ */ -+#define SMB2_SHAREFLAG_MANUAL_CACHING 0x00000000 -+#define SMB2_SHAREFLAG_AUTO_CACHING 0x00000010 -+#define SMB2_SHAREFLAG_VDO_CACHING 0x00000020 -+#define SMB2_SHAREFLAG_NO_CACHING 0x00000030 -+#define SHI1005_FLAGS_DFS 0x00000001 -+#define SHI1005_FLAGS_DFS_ROOT 0x00000002 -+#define SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS 0x00000100 -+#define SHI1005_FLAGS_FORCE_SHARED_DELETE 0x00000200 -+#define SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING 0x00000400 -+#define SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM 0x00000800 -+#define SHI1005_FLAGS_FORCE_LEVELII_OPLOCK 0x00001000 -+#define SHI1005_FLAGS_ENABLE_HASH_V1 0x00002000 -+#define SHI1005_FLAGS_ENABLE_HASH_V2 0x00004000 -+#define SHI1005_FLAGS_ENCRYPT_DATA 0x00008000 -+#define SMB2_SHAREFLAG_IDENTITY_REMOTING 0x00040000 /* 3.1.1 */ -+#define SMB2_SHAREFLAG_COMPRESS_DATA 0x00100000 /* 3.1.1 */ -+#define SHI1005_FLAGS_ALL 0x0014FF33 -+ -+/* Possible share capabilities */ -+#define SMB2_SHARE_CAP_DFS cpu_to_le32(0x00000008) /* all dialects */ -+#define SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY cpu_to_le32(0x00000010) /* 3.0 */ -+#define SMB2_SHARE_CAP_SCALEOUT cpu_to_le32(0x00000020) /* 3.0 */ -+#define SMB2_SHARE_CAP_CLUSTER cpu_to_le32(0x00000040) /* 3.0 */ -+#define SMB2_SHARE_CAP_ASYMMETRIC cpu_to_le32(0x00000080) /* 3.02 */ -+#define SMB2_SHARE_CAP_REDIRECT_TO_OWNER cpu_to_le32(0x00000100) /* 3.1.1 */ -+ -+struct smb2_tree_connect_rsp { -+ struct smb2_hdr hdr; -+ __le16 StructureSize; /* Must be 16 */ -+ __u8 ShareType; /* see below */ -+ __u8 Reserved; -+ __le32 ShareFlags; /* see below */ -+ __le32 Capabilities; /* see below */ -+ __le32 MaximalAccess; -+} __packed; -+ -+struct smb2_tree_disconnect_req { -+ struct smb2_hdr hdr; -+ __le16 StructureSize; /* Must be 4 */ -+ __le16 Reserved; -+} __packed; -+ -+struct smb2_tree_disconnect_rsp { -+ struct smb2_hdr hdr; -+ __le16 StructureSize; /* Must be 4 */ -+ __le16 Reserved; -+} __packed; -+ -+ -+#endif /* _COMMON_SMB2PDU_H */ --- -2.35.1 - diff --git a/queue-5.15/cifs-return-correct-error-in-calc_signature.patch b/queue-5.15/cifs-return-correct-error-in-calc_signature.patch index 404425a51e1..90e03ff01b6 100644 --- a/queue-5.15/cifs-return-correct-error-in-calc_signature.patch +++ b/queue-5.15/cifs-return-correct-error-in-calc_signature.patch @@ -19,18 +19,17 @@ Fixes: 32811d242ff6 ("cifs: Start using per session key for smb2/3 for signature Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - fs/cifs/smb2transport.c | 10 ++++++---- + fs/cifs/smb2transport.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c -index 2bf047b390a9..0f1c8dccbae8 100644 --- a/fs/cifs/smb2transport.c +++ b/fs/cifs/smb2transport.c -@@ -220,9 +220,9 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, +@@ -221,9 +221,9 @@ smb2_calc_signature(struct smb_rqst *rqs struct smb_rqst drqst; - ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId)); + ses = smb2_find_smb_ses(server, shdr->SessionId); - if (!ses) { + if (unlikely(!ses)) { cifs_server_dbg(VFS, "%s: Could not find session\n", __func__); @@ -39,10 +38,10 @@ index 2bf047b390a9..0f1c8dccbae8 100644 } memset(smb2_signature, 0x0, SMB2_HMACSHA256_SIZE); -@@ -541,8 +541,10 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server, +@@ -542,8 +542,10 @@ smb3_calc_signature(struct smb_rqst *rqs u8 key[SMB3_SIGN_KEY_SIZE]; - rc = smb2_get_sign_key(le64_to_cpu(shdr->SessionId), server, key); + rc = smb2_get_sign_key(shdr->SessionId, server, key); - if (rc) - return 0; + if (unlikely(rc)) { @@ -52,6 +51,3 @@ index 2bf047b390a9..0f1c8dccbae8 100644 if (allocate_crypto) { rc = cifs_alloc_hash("cmac(aes)", &hash, &sdesc); --- -2.35.1 - diff --git a/queue-5.15/nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch b/queue-5.15/nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch index e8bef519909..942501ead1e 100644 --- a/queue-5.15/nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch +++ b/queue-5.15/nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch @@ -28,16 +28,14 @@ Fixes: 0078117c6d91 ("nfsd: return RESOURCE not GARBAGE_ARGS on too many ops") Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- - fs/nfsd/nfs4proc.c | 19 +++++++++++++------ - fs/nfsd/nfs4xdr.c | 12 +++--------- - fs/nfsd/xdr4.h | 3 ++- - 3 files changed, 18 insertions(+), 16 deletions(-) + fs/nfsd/nfs4proc.c | 19 +++++++++++++------ + fs/nfsd/nfs4xdr.c | 11 +++-------- + fs/nfsd/xdr4.h | 3 ++- + 3 files changed, 18 insertions(+), 15 deletions(-) -diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c -index f7584787dab2..09dd70f79158 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c -@@ -2493,9 +2493,6 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) +@@ -2493,9 +2493,6 @@ nfsd4_proc_compound(struct svc_rqst *rqs status = nfserr_minor_vers_mismatch; if (nfsd_minorversion(nn, args->minorversion, NFSD_TEST) <= 0) goto out; @@ -47,7 +45,7 @@ index f7584787dab2..09dd70f79158 100644 status = nfs41_check_op_ordering(args); if (status) { -@@ -2508,10 +2505,20 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) +@@ -2508,10 +2505,20 @@ nfsd4_proc_compound(struct svc_rqst *rqs rqstp->rq_lease_breaker = (void **)&cstate->clp; @@ -69,7 +67,7 @@ index f7584787dab2..09dd70f79158 100644 /* * The XDR decode routines may have pre-set op->status; * for example, if there is a miscellaneous XDR error -@@ -2587,8 +2594,8 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) +@@ -2587,8 +2594,8 @@ encode_op: status = op->status; } @@ -80,32 +78,28 @@ index f7584787dab2..09dd70f79158 100644 nfsd4_cstate_clear_replay(cstate); nfsd4_increment_op_stats(op->opnum); -diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c -index 4504d1246d14..3c66517a6f0f 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c -@@ -2349,16 +2349,10 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) +@@ -2349,16 +2349,11 @@ nfsd4_decode_compound(struct nfsd4_compo if (xdr_stream_decode_u32(argp->xdr, &argp->minorversion) < 0) - return false; + return 0; - if (xdr_stream_decode_u32(argp->xdr, &argp->opcnt) < 0) + if (xdr_stream_decode_u32(argp->xdr, &argp->client_opcnt) < 0) - return false; -- + return 0; + - /* - * NFS4ERR_RESOURCE is a more helpful error than GARBAGE_ARGS - * here, so we return success at the xdr level so that - * nfsd4_proc can handle this is an NFS-level error. - */ - if (argp->opcnt > NFSD_MAX_OPS_PER_COMPOUND) -- return true; +- return 1; + argp->opcnt = min_t(u32, argp->client_opcnt, + NFSD_MAX_OPS_PER_COMPOUND); if (argp->opcnt > ARRAY_SIZE(argp->iops)) { argp->ops = kzalloc(argp->opcnt * sizeof(*argp->ops), GFP_KERNEL); -diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h -index 8812256cd520..50242d8cd09e 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -688,9 +688,10 @@ struct nfsd4_compoundargs { @@ -120,6 +114,3 @@ index 8812256cd520..50242d8cd09e 100644 u32 opcnt; struct nfsd4_op *ops; struct nfsd4_op iops[8]; --- -2.35.1 - diff --git a/queue-5.15/nfsd-return-nfserr_serverfault-if-splice_ok-but-buf-.patch b/queue-5.15/nfsd-return-nfserr_serverfault-if-splice_ok-but-buf-.patch index 39b8567c0ac..379468df664 100644 --- a/queue-5.15/nfsd-return-nfserr_serverfault-if-splice_ok-but-buf-.patch +++ b/queue-5.15/nfsd-return-nfserr_serverfault-if-splice_ok-but-buf-.patch @@ -16,14 +16,12 @@ Link: https://lore.kernel.org/linux-nfs/20220907195259.926736-1-anna@kernel.org/ Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- - fs/nfsd/nfs4xdr.c | 2 +- + fs/nfsd/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c -index 3c66517a6f0f..d85dd7060e85 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c -@@ -3987,7 +3987,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, +@@ -3988,7 +3988,7 @@ nfsd4_encode_read(struct nfsd4_compoundr if (resp->xdr->buf->page_len && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) { WARN_ON_ONCE(1); @@ -32,6 +30,3 @@ index 3c66517a6f0f..d85dd7060e85 100644 } xdr_commit_encode(xdr); --- -2.35.1 - diff --git a/queue-5.15/scsi-nvme-fc-add-new-routine-nvme_fc_io_getuuid.patch b/queue-5.15/scsi-nvme-fc-add-new-routine-nvme_fc_io_getuuid.patch deleted file mode 100644 index 7567a655c1c..00000000000 --- a/queue-5.15/scsi-nvme-fc-add-new-routine-nvme_fc_io_getuuid.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 4f53b72231d8ab8fc2953a035b95edd3fec6a26a Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 19 May 2022 05:31:07 -0700 -Subject: scsi: nvme-fc: Add new routine nvme_fc_io_getuuid() - -From: Muneendra Kumar - -[ Upstream commit 827fc630e4c8087df5a8e8ee013b686bd6f13736 ] - -Add nvme_fc_io_getuuid() to the nvme-fc transport. The routine is invoked -by the FC LLDD on a per-I/O request basis. The routine translates from the -FC-specific request structure to the bio and the cgroup structure in order -to obtain the FC appid stored in the cgroup structure. If a value is not -set or a bio is not found, a NULL appid (aka uuid) will be returned to the -LLDD. - -Link: https://lore.kernel.org/r/20220519123110.17361-2-jsmart2021@gmail.com -Reviewed-by: Hannes Reinecke -Reviewed-by: Himanshu Madhani -Acked-by: Christoph Hellwig -Signed-off-by: Muneendra Kumar -Signed-off-by: James Smart -Signed-off-by: Martin K. Petersen -Stable-dep-of: a4de8356b68e ("scsi: lpfc: Fix various issues reported by tools") -Signed-off-by: Sasha Levin ---- - drivers/nvme/host/fc.c | 18 ++++++++++++++++++ - include/linux/nvme-fc-driver.h | 14 ++++++++++++++ - 2 files changed, 32 insertions(+) - -diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c -index aa14ad963d91..fe21fd161897 100644 ---- a/drivers/nvme/host/fc.c -+++ b/drivers/nvme/host/fc.c -@@ -1898,6 +1898,24 @@ nvme_fc_ctrl_ioerr_work(struct work_struct *work) - nvme_fc_error_recovery(ctrl, "transport detected io error"); - } - -+/* -+ * nvme_fc_io_getuuid - Routine called to get the appid field -+ * associated with request by the lldd -+ * @req:IO request from nvme fc to driver -+ * Returns: UUID if there is an appid associated with VM or -+ * NULL if the user/libvirt has not set the appid to VM -+ */ -+char *nvme_fc_io_getuuid(struct nvmefc_fcp_req *req) -+{ -+ struct nvme_fc_fcp_op *op = fcp_req_to_fcp_op(req); -+ struct request *rq = op->rq; -+ -+ if (!IS_ENABLED(CONFIG_BLK_CGROUP_FC_APPID) || !rq->bio) -+ return NULL; -+ return blkcg_get_fc_appid(rq->bio); -+} -+EXPORT_SYMBOL_GPL(nvme_fc_io_getuuid); -+ - static void - nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) - { -diff --git a/include/linux/nvme-fc-driver.h b/include/linux/nvme-fc-driver.h -index 2a38f2b477a5..9a274b999a48 100644 ---- a/include/linux/nvme-fc-driver.h -+++ b/include/linux/nvme-fc-driver.h -@@ -561,6 +561,15 @@ int nvme_fc_rcv_ls_req(struct nvme_fc_remote_port *remoteport, - void *lsreqbuf, u32 lsreqbuf_len); - - -+/* -+ * Routine called to get the appid field associated with request by the lldd -+ * -+ * If the return value is NULL : the user/libvirt has not set the appid to VM -+ * If the return value is non-zero: Returns the appid associated with VM -+ * -+ * @req: IO request from nvme fc to driver -+ */ -+char *nvme_fc_io_getuuid(struct nvmefc_fcp_req *req); - - /* - * *************** LLDD FC-NVME Target/Subsystem API *************** -@@ -1041,5 +1050,10 @@ int nvmet_fc_rcv_fcp_req(struct nvmet_fc_target_port *tgtport, - - void nvmet_fc_rcv_fcp_abort(struct nvmet_fc_target_port *tgtport, - struct nvmefc_tgt_fcp_req *fcpreq); -+/* -+ * add a define, visible to the compiler, that indicates support -+ * for feature. Allows for conditional compilation in LLDDs. -+ */ -+#define NVME_FC_FEAT_UUID 0x0001 - - #endif /* _NVME_FC_DRIVER_H */ --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index cb0f2d6b87e..dcd562da687 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -147,8 +147,6 @@ nfsd-fix-a-memory-leak-in-an-error-handling-path.patch sunrpc-fix-svcxdr_init_decode-s-end-of-buffer-calcul.patch sunrpc-fix-svcxdr_init_encode-s-buflen-calculation.patch nfsd-protect-against-send-buffer-overflow-in-nfsv2-r.patch -sunrpc-replace-the-__be32-p-parameter-to-.pc_decode.patch -sunrpc-change-return-value-type-of-.pc_decode.patch nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch wifi-rtlwifi-8192de-correct-checking-of-iqk-reload.patch wifi-ath10k-add-peer-map-clean-up-for-peer-delete-in.patch @@ -158,7 +156,6 @@ wifi-mac80211-allow-bw-change-during-channel-switch-.patch bpftool-fix-a-wrong-type-cast-in-btf_dumper_int.patch spi-mt7621-fix-an-error-message-in-mt7621_spi_probe.patch x86-resctrl-fix-to-restore-to-original-value-when-re.patch -bpf-remove-unused-static-inlines.patch xsk-fix-backpressure-mechanism-on-tx.patch bpf-disable-preemption-when-increasing-per-cpu-map_l.patch bpf-propagate-error-from-htab_lock_bucket-to-userspa.patch @@ -302,7 +299,6 @@ dyndbg-fix-module.dyndbg-handling.patch dyndbg-let-query-modname-override-actual-module-name.patch dyndbg-drop-exported-dynamic_debug_exec_queries.patch clk-qcom-sm6115-select-qcom_gdsc.patch -scsi-nvme-fc-add-new-routine-nvme_fc_io_getuuid.patch mtd-devices-docg3-check-the-return-value-of-devm_ior.patch phy-amlogic-phy-meson-axg-mipi-pcie-analog-hold-refe.patch phy-phy-mtk-tphy-fix-the-phy-type-setting-issue.patch @@ -387,7 +383,6 @@ crypto-akcipher-default-implementation-for-setting-a.patch crypto-ccp-release-dma-channels-before-dmaengine-unr.patch crypto-inside-secure-change-swab-to-swab32.patch crypto-qat-fix-dma-transfer-direction.patch -cifs-create-a-new-shared-file-holding-smb2-pdu-defin.patch cifs-return-correct-error-in-calc_signature.patch iommu-iova-fix-module-config-properly.patch tracing-kprobe-fix-kprobe-event-gen-test-module-on-e.patch diff --git a/queue-5.15/sunrpc-change-return-value-type-of-.pc_decode.patch b/queue-5.15/sunrpc-change-return-value-type-of-.pc_decode.patch deleted file mode 100644 index 77ff2344338..00000000000 --- a/queue-5.15/sunrpc-change-return-value-type-of-.pc_decode.patch +++ /dev/null @@ -1,1350 +0,0 @@ -From 03be175dcba269c75dd860acd3f5c3a45ffc4c72 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Oct 2021 11:57:28 -0400 -Subject: SUNRPC: Change return value type of .pc_decode - -From: Chuck Lever - -[ Upstream commit c44b31c263798ec34614dd394c31ef1a2e7e716e ] - -Returning an undecorated integer is an age-old trope, but it's -not clear (even to previous experts in this code) that the only -valid return values are 1 and 0. These functions do not return -a negative errno, rpc_stat value, or a positive length. - -Document there are only two valid return values by having -.pc_decode return only true or false. - -Signed-off-by: Chuck Lever -Signed-off-by: J. Bruce Fields -Stable-dep-of: 7518a3dc5ea2 ("NFSD: Fix handling of oversized NFSv4 COMPOUND requests") -Signed-off-by: Sasha Levin ---- - fs/lockd/xdr.c | 96 +++++++++++++++--------------- - fs/lockd/xdr4.c | 97 +++++++++++++++--------------- - fs/nfsd/nfs2acl.c | 30 +++++----- - fs/nfsd/nfs3acl.c | 22 +++---- - fs/nfsd/nfs3xdr.c | 118 ++++++++++++++++++------------------- - fs/nfsd/nfs4xdr.c | 24 ++++---- - fs/nfsd/nfsd.h | 2 +- - fs/nfsd/nfssvc.c | 6 +- - fs/nfsd/nfsxdr.c | 62 +++++++++---------- - fs/nfsd/xdr.h | 20 +++---- - fs/nfsd/xdr3.h | 30 +++++----- - fs/nfsd/xdr4.h | 2 +- - include/linux/lockd/xdr.h | 18 +++--- - include/linux/lockd/xdr4.h | 18 +++--- - include/linux/sunrpc/svc.h | 2 +- - 15 files changed, 274 insertions(+), 273 deletions(-) - -diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c -index 895f15222104..622c2ca37dbf 100644 ---- a/fs/lockd/xdr.c -+++ b/fs/lockd/xdr.c -@@ -145,103 +145,103 @@ svcxdr_encode_testrply(struct xdr_stream *xdr, const struct nlm_res *resp) - * Decode Call arguments - */ - --int -+bool - nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &argp->block) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; - if (xdr_stream_decode_bool(xdr, &argp->reclaim) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - argp->monitor = 1; /* monitor client by default */ - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &argp->block) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - argp->lock.fl.fl_type = F_UNLCK; - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_res *resp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &resp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_stats(xdr, &resp->status)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_reboot *argp = rqstp->rq_argp; -@@ -249,25 +249,25 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - u32 len; - - if (xdr_stream_decode_u32(xdr, &len) < 0) -- return 0; -+ return false; - if (len > SM_MAXSTRLEN) -- return 0; -+ return false; - p = xdr_inline_decode(xdr, len); - if (!p) -- return 0; -+ return false; - argp->len = len; - argp->mon = (char *)p; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - p = xdr_inline_decode(xdr, SM_PRIV_SIZE); - if (!p) -- return 0; -+ return false; - memcpy(&argp->priv.data, p, sizeof(argp->priv.data)); - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; -@@ -278,34 +278,34 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - lock->svid = ~(u32)0; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) -- return 0; -+ return false; - if (!svcxdr_decode_fhandle(xdr, &lock->fh)) -- return 0; -+ return false; - if (!svcxdr_decode_owner(xdr, &lock->oh)) -- return 0; -+ return false; - /* XXX: Range checks are missing in the original code */ - if (xdr_stream_decode_u32(xdr, &argp->fsm_mode) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->fsm_access) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - - if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - -diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c -index 05f203f622d8..0173865ed39f 100644 ---- a/fs/lockd/xdr4.c -+++ b/fs/lockd/xdr4.c -@@ -129,102 +129,103 @@ svcxdr_encode_testrply(struct xdr_stream *xdr, const struct nlm_res *resp) - * Decode Call arguments - */ - --int -+bool - nlm4svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &argp->block) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; - if (xdr_stream_decode_bool(xdr, &argp->reclaim) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - argp->monitor = 1; /* monitor client by default */ - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &argp->block) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_bool(xdr, &exclusive) < 0) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - if (exclusive) - argp->lock.fl.fl_type = F_WRLCK; -- return 1; -+ -+ return true; - } - --int -+bool - nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_lock(xdr, &argp->lock)) -- return 0; -+ return false; - argp->lock.fl.fl_type = F_UNLCK; - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_res *resp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &resp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_stats(xdr, &resp->status)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_reboot *argp = rqstp->rq_argp; -@@ -232,25 +233,25 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - u32 len; - - if (xdr_stream_decode_u32(xdr, &len) < 0) -- return 0; -+ return false; - if (len > SM_MAXSTRLEN) -- return 0; -+ return false; - p = xdr_inline_decode(xdr, len); - if (!p) -- return 0; -+ return false; - argp->len = len; - argp->mon = (char *)p; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - p = xdr_inline_decode(xdr, SM_PRIV_SIZE); - if (!p) -- return 0; -+ return false; - memcpy(&argp->priv.data, p, sizeof(argp->priv.data)); - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; -@@ -261,34 +262,34 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - lock->svid = ~(u32)0; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -- return 0; -+ return false; - if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) -- return 0; -+ return false; - if (!svcxdr_decode_fhandle(xdr, &lock->fh)) -- return 0; -+ return false; - if (!svcxdr_decode_owner(xdr, &lock->oh)) -- return 0; -+ return false; - /* XXX: Range checks are missing in the original code */ - if (xdr_stream_decode_u32(xdr, &argp->fsm_mode) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->fsm_access) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nlm4svc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - - if (!svcxdr_decode_string(xdr, &lock->caller, &lock->len)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->state) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - -diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c -index 0069c0fdb94f..cf6ba5e7937e 100644 ---- a/fs/nfsd/nfs2acl.c -+++ b/fs/nfsd/nfs2acl.c -@@ -188,51 +188,51 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp) - * XDR decode functions - */ - --static int -+static bool - nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_getaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &argp->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->mask) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --static int -+static bool - nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_setaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &argp->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->mask) < 0) -- return 0; -+ return false; - if (argp->mask & ~NFS_ACL_MASK) -- return 0; -+ return false; - if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_ACL) ? - &argp->acl_access : NULL)) -- return 0; -+ return false; - if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_DFACL) ? - &argp->acl_default : NULL)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --static int -+static bool - nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_accessargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->access) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - /* -diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c -index b1e352ed2436..9e9f6afb2e00 100644 ---- a/fs/nfsd/nfs3acl.c -+++ b/fs/nfsd/nfs3acl.c -@@ -127,38 +127,38 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp) - * XDR decode functions - */ - --static int -+static bool - nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_getaclargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->mask) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --static int -+static bool - nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_setaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &argp->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &argp->mask) < 0) -- return 0; -+ return false; - if (argp->mask & ~NFS_ACL_MASK) -- return 0; -+ return false; - if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_ACL) ? - &argp->acl_access : NULL)) -- return 0; -+ return false; - if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_DFACL) ? - &argp->acl_default : NULL)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - /* -diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c -index 4ce0cdb3751d..2b2307666859 100644 ---- a/fs/nfsd/nfs3xdr.c -+++ b/fs/nfsd/nfs3xdr.c -@@ -546,7 +546,7 @@ void fill_post_wcc(struct svc_fh *fhp) - * XDR decode functions - */ - --int -+bool - nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_fhandle *args = rqstp->rq_argp; -@@ -554,7 +554,7 @@ nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - return svcxdr_decode_nfs_fh3(xdr, &args->fh); - } - --int -+bool - nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_sattrargs *args = rqstp->rq_argp; -@@ -564,7 +564,7 @@ nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - svcxdr_decode_sattrguard3(xdr, args); - } - --int -+bool - nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_diropargs *args = rqstp->rq_argp; -@@ -572,75 +572,75 @@ nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - return svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len); - } - --int -+bool - nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_accessargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->access) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_readargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u64(xdr, &args->offset) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_writeargs *args = rqstp->rq_argp; - u32 max_blocksize = svc_max_payload(rqstp); - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u64(xdr, &args->offset) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->stable) < 0) -- return 0; -+ return false; - - /* opaque data */ - if (xdr_stream_decode_u32(xdr, &args->len) < 0) -- return 0; -+ return false; - - /* request sanity */ - if (args->count != args->len) -- return 0; -+ return false; - if (args->count > max_blocksize) { - args->count = max_blocksize; - args->len = max_blocksize; - } - if (!xdr_stream_subsegment(xdr, &args->payload, args->count)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_createargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->createmode) < 0) -- return 0; -+ return false; - switch (args->createmode) { - case NFS3_CREATE_UNCHECKED: - case NFS3_CREATE_GUARDED: -@@ -648,15 +648,15 @@ nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - case NFS3_CREATE_EXCLUSIVE: - args->verf = xdr_inline_decode(xdr, NFS3_CREATEVERFSIZE); - if (!args->verf) -- return 0; -+ return false; - break; - default: -- return 0; -+ return false; - } -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_createargs *args = rqstp->rq_argp; -@@ -666,7 +666,7 @@ nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - svcxdr_decode_sattr3(rqstp, xdr, &args->attrs); - } - --int -+bool - nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_symlinkargs *args = rqstp->rq_argp; -@@ -675,33 +675,33 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - size_t remaining; - - if (!svcxdr_decode_diropargs3(xdr, &args->ffh, &args->fname, &args->flen)) -- return 0; -+ return false; - if (!svcxdr_decode_sattr3(rqstp, xdr, &args->attrs)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->tlen) < 0) -- return 0; -+ return false; - - /* request sanity */ - remaining = head->iov_len + rqstp->rq_arg.page_len + tail->iov_len; - remaining -= xdr_stream_pos(xdr); - if (remaining < xdr_align_size(args->tlen)) -- return 0; -+ return false; - - args->first.iov_base = xdr->p; - args->first.iov_len = head->iov_len - xdr_stream_pos(xdr); - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_mknodargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->ftype) < 0) -- return 0; -+ return false; - switch (args->ftype) { - case NF3CHR: - case NF3BLK: -@@ -715,13 +715,13 @@ nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - /* Valid XDR but illegal file types */ - break; - default: -- return 0; -+ return false; - } - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_renameargs *args = rqstp->rq_argp; -@@ -732,7 +732,7 @@ nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - &args->tname, &args->tlen); - } - --int -+bool - nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_linkargs *args = rqstp->rq_argp; -@@ -742,59 +742,59 @@ nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - &args->tname, &args->tlen); - } - --int -+bool - nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_readdirargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u64(xdr, &args->cookie) < 0) -- return 0; -+ return false; - args->verf = xdr_inline_decode(xdr, NFS3_COOKIEVERFSIZE); - if (!args->verf) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_readdirargs *args = rqstp->rq_argp; - u32 dircount; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u64(xdr, &args->cookie) < 0) -- return 0; -+ return false; - args->verf = xdr_inline_decode(xdr, NFS3_COOKIEVERFSIZE); - if (!args->verf) -- return 0; -+ return false; - /* dircount is ignored */ - if (xdr_stream_decode_u32(xdr, &dircount) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd3_commitargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u64(xdr, &args->offset) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - /* -diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c -index 3a2a73a85032..4504d1246d14 100644 ---- a/fs/nfsd/nfs4xdr.c -+++ b/fs/nfsd/nfs4xdr.c -@@ -2319,7 +2319,7 @@ nfsd4_opnum_in_range(struct nfsd4_compoundargs *argp, struct nfsd4_op *op) - return true; - } - --static int -+static bool - nfsd4_decode_compound(struct nfsd4_compoundargs *argp) - { - struct nfsd4_op *op; -@@ -2332,25 +2332,25 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) - int i; - - if (xdr_stream_decode_u32(argp->xdr, &argp->taglen) < 0) -- return 0; -+ return false; - max_reply += XDR_UNIT; - argp->tag = NULL; - if (unlikely(argp->taglen)) { - if (argp->taglen > NFSD4_MAX_TAGLEN) -- return 0; -+ return false; - p = xdr_inline_decode(argp->xdr, argp->taglen); - if (!p) -- return 0; -+ return false; - argp->tag = svcxdr_savemem(argp, p, argp->taglen); - if (!argp->tag) -- return 0; -+ return false; - max_reply += xdr_align_size(argp->taglen); - } - - if (xdr_stream_decode_u32(argp->xdr, &argp->minorversion) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(argp->xdr, &argp->opcnt) < 0) -- return 0; -+ return false; - - /* - * NFS4ERR_RESOURCE is a more helpful error than GARBAGE_ARGS -@@ -2358,14 +2358,14 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) - * nfsd4_proc can handle this is an NFS-level error. - */ - if (argp->opcnt > NFSD_MAX_OPS_PER_COMPOUND) -- return 1; -+ return true; - - if (argp->opcnt > ARRAY_SIZE(argp->iops)) { - argp->ops = kzalloc(argp->opcnt * sizeof(*argp->ops), GFP_KERNEL); - if (!argp->ops) { - argp->ops = argp->iops; - dprintk("nfsd: couldn't allocate room for COMPOUND\n"); -- return 0; -+ return false; - } - } - -@@ -2377,7 +2377,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) - op->replay = NULL; - - if (xdr_stream_decode_u32(argp->xdr, &op->opnum) < 0) -- return 0; -+ return false; - if (nfsd4_opnum_in_range(argp, op)) { - op->status = nfsd4_dec_ops[op->opnum](argp, &op->u); - if (op->status != nfs_ok) -@@ -2424,7 +2424,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) - if (readcount > 1 || max_reply > PAGE_SIZE - auth_slack) - clear_bit(RQ_SPLICE_OK, &argp->rqstp->rq_flags); - -- return 1; -+ return true; - } - - static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode, -@@ -5407,7 +5407,7 @@ void nfsd4_release_compoundargs(struct svc_rqst *rqstp) - } - } - --int -+bool - nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd4_compoundargs *args = rqstp->rq_argp; -diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h -index 6e8ad5f9757c..bfcddd4c7534 100644 ---- a/fs/nfsd/nfsd.h -+++ b/fs/nfsd/nfsd.h -@@ -78,7 +78,7 @@ extern const struct seq_operations nfs_exports_op; - */ - struct nfsd_voidargs { }; - struct nfsd_voidres { }; --int nfssvc_decode_voidarg(struct svc_rqst *rqstp, -+bool nfssvc_decode_voidarg(struct svc_rqst *rqstp, - struct xdr_stream *xdr); - int nfssvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p); - -diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c -index 7cd13e9474ff..beb564e8a3db 100644 ---- a/fs/nfsd/nfssvc.c -+++ b/fs/nfsd/nfssvc.c -@@ -1067,10 +1067,10 @@ int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) - * @xdr: XDR stream positioned at arguments to decode - * - * Return values: -- * %0: Arguments were not valid -- * %1: Decoding was successful -+ * %false: Arguments were not valid -+ * %true: Decoding was successful - */ --int nfssvc_decode_voidarg(struct svc_rqst *rqstp, struct xdr_stream *xdr) -+bool nfssvc_decode_voidarg(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - return 1; - } -diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c -index 38c4b199a10f..921c1c4344ef 100644 ---- a/fs/nfsd/nfsxdr.c -+++ b/fs/nfsd/nfsxdr.c -@@ -272,7 +272,7 @@ svcxdr_encode_fattr(struct svc_rqst *rqstp, struct xdr_stream *xdr, - * XDR decode functions - */ - --int -+bool - nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_fhandle *args = rqstp->rq_argp; -@@ -280,7 +280,7 @@ nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - return svcxdr_decode_fhandle(xdr, &args->fh); - } - --int -+bool - nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_sattrargs *args = rqstp->rq_argp; -@@ -289,7 +289,7 @@ nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - svcxdr_decode_sattr(rqstp, xdr, &args->attrs); - } - --int -+bool - nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_diropargs *args = rqstp->rq_argp; -@@ -297,54 +297,54 @@ nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - return svcxdr_decode_diropargs(xdr, &args->fh, &args->name, &args->len); - } - --int -+bool - nfssvc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_readargs *args = rqstp->rq_argp; - u32 totalcount; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->offset) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - /* totalcount is ignored */ - if (xdr_stream_decode_u32(xdr, &totalcount) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_writeargs *args = rqstp->rq_argp; - u32 beginoffset, totalcount; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -- return 0; -+ return false; - /* beginoffset is ignored */ - if (xdr_stream_decode_u32(xdr, &beginoffset) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->offset) < 0) -- return 0; -+ return false; - /* totalcount is ignored */ - if (xdr_stream_decode_u32(xdr, &totalcount) < 0) -- return 0; -+ return false; - - /* opaque data */ - if (xdr_stream_decode_u32(xdr, &args->len) < 0) -- return 0; -+ return false; - if (args->len > NFSSVC_MAXBLKSIZE_V2) -- return 0; -+ return false; - if (!xdr_stream_subsegment(xdr, &args->payload, args->len)) -- return 0; -+ return false; - -- return 1; -+ return true; - } - --int -+bool - nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_createargs *args = rqstp->rq_argp; -@@ -354,7 +354,7 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - svcxdr_decode_sattr(rqstp, xdr, &args->attrs); - } - --int -+bool - nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_renameargs *args = rqstp->rq_argp; -@@ -365,7 +365,7 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - &args->tname, &args->tlen); - } - --int -+bool - nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_linkargs *args = rqstp->rq_argp; -@@ -375,39 +375,39 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - &args->tname, &args->tlen); - } - --int -+bool - nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_symlinkargs *args = rqstp->rq_argp; - struct kvec *head = rqstp->rq_arg.head; - - if (!svcxdr_decode_diropargs(xdr, &args->ffh, &args->fname, &args->flen)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->tlen) < 0) -- return 0; -+ return false; - if (args->tlen == 0) -- return 0; -+ return false; - - args->first.iov_len = head->iov_len - xdr_stream_pos(xdr); - args->first.iov_base = xdr_inline_decode(xdr, args->tlen); - if (!args->first.iov_base) -- return 0; -+ return false; - return svcxdr_decode_sattr(rqstp, xdr, &args->attrs); - } - --int -+bool - nfssvc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd_readdirargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->cookie) < 0) -- return 0; -+ return false; - if (xdr_stream_decode_u32(xdr, &args->count) < 0) -- return 0; -+ return false; - -- return 1; -+ return true; - } - - /* -diff --git a/fs/nfsd/xdr.h b/fs/nfsd/xdr.h -index 19e281382bb9..d897c198c912 100644 ---- a/fs/nfsd/xdr.h -+++ b/fs/nfsd/xdr.h -@@ -141,16 +141,16 @@ union nfsd_xdrstore { - #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) - - --int nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfssvc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfssvc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); - - int nfssvc_encode_statres(struct svc_rqst *, __be32 *); - int nfssvc_encode_attrstatres(struct svc_rqst *, __be32 *); -diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h -index 60a8909205e5..ef72bc4868da 100644 ---- a/fs/nfsd/xdr3.h -+++ b/fs/nfsd/xdr3.h -@@ -265,21 +265,21 @@ union nfsd3_xdrstore { - - #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) - --int nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); - - int nfs3svc_encode_getattrres(struct svc_rqst *, __be32 *); - int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *); -diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h -index 1d1b8771bdcf..8812256cd520 100644 ---- a/fs/nfsd/xdr4.h -+++ b/fs/nfsd/xdr4.h -@@ -756,7 +756,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) - - - bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); --int nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); - int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *); - __be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); - void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); -diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h -index 931bd0b064e6..a3d0bc4fd210 100644 ---- a/include/linux/lockd/xdr.h -+++ b/include/linux/lockd/xdr.h -@@ -98,15 +98,15 @@ struct nlm_reboot { - */ - #define NLMSVC_XDRSIZE sizeof(struct nlm_args) - --int nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); - - int nlmsvc_encode_testres(struct svc_rqst *, __be32 *); - int nlmsvc_encode_res(struct svc_rqst *, __be32 *); -diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h -index 68e14e0f2b1f..376b8f6a3763 100644 ---- a/include/linux/lockd/xdr4.h -+++ b/include/linux/lockd/xdr4.h -@@ -22,15 +22,15 @@ - #define nlm4_fbig cpu_to_be32(NLM_FBIG) - #define nlm4_failed cpu_to_be32(NLM_FAILED) - --int nlm4svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); --int nlm4svc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+bool nlm4svc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); - - int nlm4svc_encode_testres(struct svc_rqst *, __be32 *); - int nlm4svc_encode_res(struct svc_rqst *, __be32 *); -diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h -index 4eaad981a89f..56a4e6b2de7e 100644 ---- a/include/linux/sunrpc/svc.h -+++ b/include/linux/sunrpc/svc.h -@@ -458,7 +458,7 @@ struct svc_procedure { - /* process the request: */ - __be32 (*pc_func)(struct svc_rqst *); - /* XDR decode args: */ -- int (*pc_decode)(struct svc_rqst *rqstp, -+ bool (*pc_decode)(struct svc_rqst *rqstp, - struct xdr_stream *xdr); - /* XDR encode result: */ - int (*pc_encode)(struct svc_rqst *, __be32 *data); --- -2.35.1 - diff --git a/queue-5.15/sunrpc-replace-the-__be32-p-parameter-to-.pc_decode.patch b/queue-5.15/sunrpc-replace-the-__be32-p-parameter-to-.pc_decode.patch deleted file mode 100644 index f29e8250f63..00000000000 --- a/queue-5.15/sunrpc-replace-the-__be32-p-parameter-to-.pc_decode.patch +++ /dev/null @@ -1,849 +0,0 @@ -From d42246ab2d8bc058fba38276edb80a021d57f8ce Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 12 Oct 2021 11:57:22 -0400 -Subject: SUNRPC: Replace the "__be32 *p" parameter to .pc_decode - -From: Chuck Lever - -[ Upstream commit 16c663642c7ec03cd4cee5fec520bb69e97babe4 ] - -The passed-in value of the "__be32 *p" parameter is now unused in -every server-side XDR decoder, and can be removed. - -Note also that there is a line in each decoder that sets up a local -pointer to a struct xdr_stream. Passing that pointer from the -dispatcher instead saves one line per decoder function. - -Signed-off-by: Chuck Lever -Signed-off-by: J. Bruce Fields -Stable-dep-of: 7518a3dc5ea2 ("NFSD: Fix handling of oversized NFSv4 COMPOUND requests") -Signed-off-by: Sasha Levin ---- - fs/lockd/svc.c | 3 +-- - fs/lockd/xdr.c | 27 +++++++++-------------- - fs/lockd/xdr4.c | 27 +++++++++-------------- - fs/nfsd/nfs2acl.c | 12 +++++----- - fs/nfsd/nfs3acl.c | 8 +++---- - fs/nfsd/nfs3xdr.c | 45 +++++++++++++------------------------- - fs/nfsd/nfs4xdr.c | 4 ++-- - fs/nfsd/nfsd.h | 3 ++- - fs/nfsd/nfssvc.c | 7 +++--- - fs/nfsd/nfsxdr.c | 30 +++++++++---------------- - fs/nfsd/xdr.h | 21 +++++++++--------- - fs/nfsd/xdr3.h | 31 +++++++++++++------------- - fs/nfsd/xdr4.h | 2 +- - include/linux/lockd/xdr.h | 19 ++++++++-------- - include/linux/lockd/xdr4.h | 19 ++++++++-------- - include/linux/sunrpc/svc.h | 3 ++- - 16 files changed, 112 insertions(+), 149 deletions(-) - -diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c -index b632be3ad57b..9a82471bda07 100644 ---- a/fs/lockd/svc.c -+++ b/fs/lockd/svc.c -@@ -780,11 +780,10 @@ module_exit(exit_nlm); - static int nlmsvc_dispatch(struct svc_rqst *rqstp, __be32 *statp) - { - const struct svc_procedure *procp = rqstp->rq_procinfo; -- struct kvec *argv = rqstp->rq_arg.head; - struct kvec *resv = rqstp->rq_res.head; - - svcxdr_init_decode(rqstp); -- if (!procp->pc_decode(rqstp, argv->iov_base)) -+ if (!procp->pc_decode(rqstp, &rqstp->rq_arg_stream)) - goto out_decode_err; - - *statp = procp->pc_func(rqstp); -diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c -index 9235e60b1769..895f15222104 100644 ---- a/fs/lockd/xdr.c -+++ b/fs/lockd/xdr.c -@@ -146,15 +146,14 @@ svcxdr_encode_testrply(struct xdr_stream *xdr, const struct nlm_res *resp) - */ - - int --nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - return 1; - } - - int --nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -171,9 +170,8 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -197,9 +195,8 @@ nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -218,9 +215,8 @@ nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -@@ -233,9 +229,8 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_res *resp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &resp->cookie)) -@@ -247,10 +242,10 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_reboot *argp = rqstp->rq_argp; -+ __be32 *p; - u32 len; - - if (xdr_stream_decode_u32(xdr, &len) < 0) -@@ -273,9 +268,8 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - -@@ -301,9 +295,8 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p) -+nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - -diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c -index 72f7d190fb3b..05f203f622d8 100644 ---- a/fs/lockd/xdr4.c -+++ b/fs/lockd/xdr4.c -@@ -130,15 +130,14 @@ svcxdr_encode_testrply(struct xdr_stream *xdr, const struct nlm_res *resp) - */ - - int --nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - return 1; - } - - int --nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -155,9 +154,8 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -181,9 +179,8 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - u32 exclusive; - -@@ -201,9 +198,8 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &argp->cookie)) -@@ -216,9 +212,8 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_res *resp = rqstp->rq_argp; - - if (!svcxdr_decode_cookie(xdr, &resp->cookie)) -@@ -230,10 +225,10 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_reboot *argp = rqstp->rq_argp; -+ __be32 *p; - u32 len; - - if (xdr_stream_decode_u32(xdr, &len) < 0) -@@ -256,9 +251,8 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - -@@ -284,9 +278,8 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p) -+nlm4svc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nlm_args *argp = rqstp->rq_argp; - struct nlm_lock *lock = &argp->lock; - -diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c -index 4b43929c1f25..0069c0fdb94f 100644 ---- a/fs/nfsd/nfs2acl.c -+++ b/fs/nfsd/nfs2acl.c -@@ -188,9 +188,9 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp) - * XDR decode functions - */ - --static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p) -+static int -+nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_getaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &argp->fh)) -@@ -201,9 +201,9 @@ static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p) - return 1; - } - --static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p) -+static int -+nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_setaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &argp->fh)) -@@ -222,9 +222,9 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p) - return 1; - } - --static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p) -+static int -+nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_accessargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c -index 5dfe7644a517..b1e352ed2436 100644 ---- a/fs/nfsd/nfs3acl.c -+++ b/fs/nfsd/nfs3acl.c -@@ -127,9 +127,9 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp) - * XDR decode functions - */ - --static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p) -+static int -+nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_getaclargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -@@ -140,9 +140,9 @@ static int nfs3svc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p) - return 1; - } - --static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p) -+static int -+nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_setaclargs *argp = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &argp->fh)) -diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c -index 48d4f99b7f90..4ce0cdb3751d 100644 ---- a/fs/nfsd/nfs3xdr.c -+++ b/fs/nfsd/nfs3xdr.c -@@ -547,18 +547,16 @@ void fill_post_wcc(struct svc_fh *fhp) - */ - - int --nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_fhandle *args = rqstp->rq_argp; - - return svcxdr_decode_nfs_fh3(xdr, &args->fh); - } - - int --nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_sattrargs *args = rqstp->rq_argp; - - return svcxdr_decode_nfs_fh3(xdr, &args->fh) && -@@ -567,18 +565,16 @@ nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_diropargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len); - } - - int --nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_accessargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -@@ -590,9 +586,8 @@ nfs3svc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_readargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -@@ -606,9 +601,8 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_writeargs *args = rqstp->rq_argp; - u32 max_blocksize = svc_max_payload(rqstp); - -@@ -639,9 +633,8 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_createargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len)) -@@ -664,9 +657,8 @@ nfs3svc_decode_createargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_createargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs3(xdr, &args->fh, -@@ -675,9 +667,8 @@ nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_symlinkargs *args = rqstp->rq_argp; - struct kvec *head = rqstp->rq_arg.head; - struct kvec *tail = rqstp->rq_arg.tail; -@@ -703,9 +694,8 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_mknodargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_diropargs3(xdr, &args->fh, &args->name, &args->len)) -@@ -732,9 +722,8 @@ nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_renameargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs3(xdr, &args->ffh, -@@ -744,9 +733,8 @@ nfs3svc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_linkargs *args = rqstp->rq_argp; - - return svcxdr_decode_nfs_fh3(xdr, &args->ffh) && -@@ -755,9 +743,8 @@ nfs3svc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_readdirargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -@@ -774,9 +761,8 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_readdirargs *args = rqstp->rq_argp; - u32 dircount; - -@@ -797,9 +783,8 @@ nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfs3svc_decode_commitargs(struct svc_rqst *rqstp, __be32 *p) -+nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd3_commitargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_nfs_fh3(xdr, &args->fh)) -diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c -index f6d385e0efec..3a2a73a85032 100644 ---- a/fs/nfsd/nfs4xdr.c -+++ b/fs/nfsd/nfs4xdr.c -@@ -5408,14 +5408,14 @@ void nfsd4_release_compoundargs(struct svc_rqst *rqstp) - } - - int --nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p) -+nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - struct nfsd4_compoundargs *args = rqstp->rq_argp; - - /* svcxdr_tmp_alloc */ - args->to_free = NULL; - -- args->xdr = &rqstp->rq_arg_stream; -+ args->xdr = xdr; - args->ops = args->iops; - args->rqstp = rqstp; - -diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h -index 9664303afdaf..6e8ad5f9757c 100644 ---- a/fs/nfsd/nfsd.h -+++ b/fs/nfsd/nfsd.h -@@ -78,7 +78,8 @@ extern const struct seq_operations nfs_exports_op; - */ - struct nfsd_voidargs { }; - struct nfsd_voidres { }; --int nfssvc_decode_voidarg(struct svc_rqst *rqstp, __be32 *p); -+int nfssvc_decode_voidarg(struct svc_rqst *rqstp, -+ struct xdr_stream *xdr); - int nfssvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p); - - /* -diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c -index ccb59e91011b..7cd13e9474ff 100644 ---- a/fs/nfsd/nfssvc.c -+++ b/fs/nfsd/nfssvc.c -@@ -1004,7 +1004,6 @@ nfsd(void *vrqstp) - int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) - { - const struct svc_procedure *proc = rqstp->rq_procinfo; -- struct kvec *argv = &rqstp->rq_arg.head[0]; - struct kvec *resv = &rqstp->rq_res.head[0]; - __be32 *p; - -@@ -1015,7 +1014,7 @@ int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) - rqstp->rq_cachetype = proc->pc_cachetype; - - svcxdr_init_decode(rqstp); -- if (!proc->pc_decode(rqstp, argv->iov_base)) -+ if (!proc->pc_decode(rqstp, &rqstp->rq_arg_stream)) - goto out_decode_err; - - switch (nfsd_cache_lookup(rqstp)) { -@@ -1065,13 +1064,13 @@ int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) - /** - * nfssvc_decode_voidarg - Decode void arguments - * @rqstp: Server RPC transaction context -- * @p: buffer containing arguments to decode -+ * @xdr: XDR stream positioned at arguments to decode - * - * Return values: - * %0: Arguments were not valid - * %1: Decoding was successful - */ --int nfssvc_decode_voidarg(struct svc_rqst *rqstp, __be32 *p) -+int nfssvc_decode_voidarg(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { - return 1; - } -diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c -index 26a42f87c240..38c4b199a10f 100644 ---- a/fs/nfsd/nfsxdr.c -+++ b/fs/nfsd/nfsxdr.c -@@ -273,18 +273,16 @@ svcxdr_encode_fattr(struct svc_rqst *rqstp, struct xdr_stream *xdr, - */ - - int --nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_fhandle *args = rqstp->rq_argp; - - return svcxdr_decode_fhandle(xdr, &args->fh); - } - - int --nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_sattrargs *args = rqstp->rq_argp; - - return svcxdr_decode_fhandle(xdr, &args->fh) && -@@ -292,18 +290,16 @@ nfssvc_decode_sattrargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_diropargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_diropargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs(xdr, &args->fh, &args->name, &args->len); - } - - int --nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_readargs *args = rqstp->rq_argp; - u32 totalcount; - -@@ -321,9 +317,8 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_writeargs *args = rqstp->rq_argp; - u32 beginoffset, totalcount; - -@@ -350,9 +345,8 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_createargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs(xdr, &args->fh, -@@ -361,9 +355,8 @@ nfssvc_decode_createargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_renameargs *args = rqstp->rq_argp; - - return svcxdr_decode_diropargs(xdr, &args->ffh, -@@ -373,9 +366,8 @@ nfssvc_decode_renameargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_linkargs *args = rqstp->rq_argp; - - return svcxdr_decode_fhandle(xdr, &args->ffh) && -@@ -384,9 +376,8 @@ nfssvc_decode_linkargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_symlinkargs *args = rqstp->rq_argp; - struct kvec *head = rqstp->rq_arg.head; - -@@ -405,9 +396,8 @@ nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p) - } - - int --nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) -+nfssvc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) - { -- struct xdr_stream *xdr = &rqstp->rq_arg_stream; - struct nfsd_readdirargs *args = rqstp->rq_argp; - - if (!svcxdr_decode_fhandle(xdr, &args->fh)) -diff --git a/fs/nfsd/xdr.h b/fs/nfsd/xdr.h -index 863a35f24910..19e281382bb9 100644 ---- a/fs/nfsd/xdr.h -+++ b/fs/nfsd/xdr.h -@@ -141,16 +141,17 @@ union nfsd_xdrstore { - #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) - - --int nfssvc_decode_fhandleargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_readargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_createargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *); --int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *); -+int nfssvc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfssvc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+ - int nfssvc_encode_statres(struct svc_rqst *, __be32 *); - int nfssvc_encode_attrstatres(struct svc_rqst *, __be32 *); - int nfssvc_encode_diropres(struct svc_rqst *, __be32 *); -diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h -index 712c117300cb..60a8909205e5 100644 ---- a/fs/nfsd/xdr3.h -+++ b/fs/nfsd/xdr3.h -@@ -265,21 +265,22 @@ union nfsd3_xdrstore { - - #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) - --int nfs3svc_decode_fhandleargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *); --int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *); -+int nfs3svc_decode_fhandleargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_sattrargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_diropargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_readargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_writeargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_createargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_mkdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_mknodargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_renameargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_linkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_readdirplusargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nfs3svc_decode_commitargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+ - int nfs3svc_encode_getattrres(struct svc_rqst *, __be32 *); - int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *); - int nfs3svc_encode_lookupres(struct svc_rqst *, __be32 *); -diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h -index 3e4052e3bd50..1d1b8771bdcf 100644 ---- a/fs/nfsd/xdr4.h -+++ b/fs/nfsd/xdr4.h -@@ -756,7 +756,7 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) - - - bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); --int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *); -+int nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); - int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *); - __be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); - void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); -diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h -index bed63156b052..931bd0b064e6 100644 ---- a/include/linux/lockd/xdr.h -+++ b/include/linux/lockd/xdr.h -@@ -98,18 +98,19 @@ struct nlm_reboot { - */ - #define NLMSVC_XDRSIZE sizeof(struct nlm_args) - --int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *); -+int nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+ - int nlmsvc_encode_testres(struct svc_rqst *, __be32 *); --int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *); --int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *); --int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *); - int nlmsvc_encode_res(struct svc_rqst *, __be32 *); --int nlmsvc_decode_res(struct svc_rqst *, __be32 *); - int nlmsvc_encode_void(struct svc_rqst *, __be32 *); --int nlmsvc_decode_void(struct svc_rqst *, __be32 *); --int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *); - int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *); --int nlmsvc_decode_notify(struct svc_rqst *, __be32 *); --int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *); - - #endif /* LOCKD_XDR_H */ -diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h -index 5ae766f26e04..68e14e0f2b1f 100644 ---- a/include/linux/lockd/xdr4.h -+++ b/include/linux/lockd/xdr4.h -@@ -22,21 +22,20 @@ - #define nlm4_fbig cpu_to_be32(NLM_FBIG) - #define nlm4_failed cpu_to_be32(NLM_FAILED) - -+int nlm4svc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr); -+int nlm4svc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr); - -- --int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *); - int nlm4svc_encode_testres(struct svc_rqst *, __be32 *); --int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *); --int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *); --int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *); - int nlm4svc_encode_res(struct svc_rqst *, __be32 *); --int nlm4svc_decode_res(struct svc_rqst *, __be32 *); - int nlm4svc_encode_void(struct svc_rqst *, __be32 *); --int nlm4svc_decode_void(struct svc_rqst *, __be32 *); --int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *); - int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *); --int nlm4svc_decode_notify(struct svc_rqst *, __be32 *); --int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *); - - extern const struct rpc_version nlm_version4; - -diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h -index 045f34add206..4eaad981a89f 100644 ---- a/include/linux/sunrpc/svc.h -+++ b/include/linux/sunrpc/svc.h -@@ -458,7 +458,8 @@ struct svc_procedure { - /* process the request: */ - __be32 (*pc_func)(struct svc_rqst *); - /* XDR decode args: */ -- int (*pc_decode)(struct svc_rqst *, __be32 *data); -+ int (*pc_decode)(struct svc_rqst *rqstp, -+ struct xdr_stream *xdr); - /* XDR encode result: */ - int (*pc_encode)(struct svc_rqst *, __be32 *data); - /* XDR free result: */ --- -2.35.1 - diff --git a/queue-5.15/xsk-fix-backpressure-mechanism-on-tx.patch b/queue-5.15/xsk-fix-backpressure-mechanism-on-tx.patch index 00f718a37f8..fb06f01735f 100644 --- a/queue-5.15/xsk-fix-backpressure-mechanism-on-tx.patch +++ b/queue-5.15/xsk-fix-backpressure-mechanism-on-tx.patch @@ -42,15 +42,13 @@ Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220830121705.8618-1-maciej.fijalkowski@intel.com Signed-off-by: Sasha Levin --- - net/xdp/xsk.c | 22 +++++++++++----------- - net/xdp/xsk_queue.h | 22 ++++++++++------------ + net/xdp/xsk.c | 22 +++++++++++----------- + net/xdp/xsk_queue.h | 22 ++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) -diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c -index 10c302f9c6d7..330dd498fc61 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c -@@ -370,16 +370,15 @@ static u32 xsk_tx_peek_release_fallback(struct xsk_buff_pool *pool, u32 max_entr +@@ -370,16 +370,15 @@ static u32 xsk_tx_peek_release_fallback( return nb_pkts; } @@ -69,7 +67,7 @@ index 10c302f9c6d7..330dd498fc61 100644 } xs = list_first_or_null_rcu(&pool->xsk_tx_list, struct xdp_sock, tx_list); -@@ -388,12 +387,7 @@ u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max_entries) +@@ -388,12 +387,7 @@ u32 xsk_tx_peek_release_desc_batch(struc goto out; } @@ -83,7 +81,7 @@ index 10c302f9c6d7..330dd498fc61 100644 /* This is the backpressure mechanism for the Tx path. Try to * reserve space in the completion queue for all packets, but -@@ -401,12 +395,18 @@ u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max_entries) +@@ -401,12 +395,18 @@ u32 xsk_tx_peek_release_desc_batch(struc * packets. This avoids having to implement any buffering in * the Tx path. */ @@ -104,11 +102,9 @@ index 10c302f9c6d7..330dd498fc61 100644 xs->sk.sk_write_space(&xs->sk); out: -diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h -index 0e59b4611f18..51db44bd0b60 100644 --- a/net/xdp/xsk_queue.h +++ b/net/xdp/xsk_queue.h -@@ -201,6 +201,11 @@ static inline bool xskq_cons_read_desc(struct xsk_queue *q, +@@ -201,6 +201,11 @@ static inline bool xskq_cons_read_desc(s return false; } @@ -120,7 +116,7 @@ index 0e59b4611f18..51db44bd0b60 100644 static inline u32 xskq_cons_read_desc_batch(struct xsk_queue *q, struct xsk_buff_pool *pool, u32 max) { -@@ -222,6 +227,8 @@ static inline u32 xskq_cons_read_desc_batch(struct xsk_queue *q, struct xsk_buff +@@ -222,6 +227,8 @@ static inline u32 xskq_cons_read_desc_ba cached_cons++; } @@ -129,7 +125,7 @@ index 0e59b4611f18..51db44bd0b60 100644 return nb_entries; } -@@ -287,11 +294,6 @@ static inline void xskq_cons_release(struct xsk_queue *q) +@@ -287,11 +294,6 @@ static inline void xskq_cons_release(str q->cached_cons++; } @@ -138,10 +134,10 @@ index 0e59b4611f18..51db44bd0b60 100644 - q->cached_cons += cnt; -} - - static inline u32 xskq_cons_present_entries(struct xsk_queue *q) + static inline bool xskq_cons_is_full(struct xsk_queue *q) { /* No barriers needed since data is not accessed */ -@@ -346,21 +348,17 @@ static inline int xskq_prod_reserve_addr(struct xsk_queue *q, u64 addr) +@@ -353,21 +355,17 @@ static inline int xskq_prod_reserve_addr return 0; } @@ -166,6 +162,3 @@ index 0e59b4611f18..51db44bd0b60 100644 } static inline int xskq_prod_reserve_desc(struct xsk_queue *q, --- -2.35.1 - -- 2.47.3