Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/srp: Add more structure size checks

Before modifying how the __packed attribute is used, add compile time
size checks for the structures that will be modified.

Link: https://lore.kernel.org/r/20210524041211.9480-3-bvanassche@acm.org
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Cc: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Bart Van Assche and committed by
Jason Gunthorpe
c838de1a 17bb6b6b

+4 -1
+4 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 4078 4078 { 4079 4079 int ret; 4080 4080 4081 + BUILD_BUG_ON(sizeof(struct srp_aer_req) != 36); 4082 + BUILD_BUG_ON(sizeof(struct srp_cmd) != 48); 4081 4083 BUILD_BUG_ON(sizeof(struct srp_imm_buf) != 4); 4084 + BUILD_BUG_ON(sizeof(struct srp_indirect_buf) != 20); 4082 4085 BUILD_BUG_ON(sizeof(struct srp_login_req) != 64); 4083 4086 BUILD_BUG_ON(sizeof(struct srp_login_req_rdma) != 56); 4084 - BUILD_BUG_ON(sizeof(struct srp_cmd) != 48); 4087 + BUILD_BUG_ON(sizeof(struct srp_rsp) != 36); 4085 4088 4086 4089 if (srp_sg_tablesize) { 4087 4090 pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n");