History

xprtrdma: fix incorrect header size calculations

Currently the header size calculations are using an assignment operator instead of a += operator when accumulating the header size leading to incorrect sizes. Fix this by using the correct operator.

Colin Ian King committed 6 years ago

Commit 91228841 parent 913fadc1 file · +2 −2Browse files

Unified · Split

net/sunrpc/xprtrdma/rpc_rdma.c+2−2
@@ -71,7 +71,7 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs) · 70 unmodified lines
71 size = RPCRDMA_HDRLEN_MIN;71 size = RPCRDMA_HDRLEN_MIN;
72 72
73 /* Maximum Read list size */73 /* Maximum Read list size */
74 size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);74 size += maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32);
75 75
76 /* Minimal Read chunk size */76 /* Minimal Read chunk size */
77 size += sizeof(__be32); /* segment count */77 size += sizeof(__be32); /* segment count */
@@ -94,7 +94,7 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs) · 16 unmodified lines
94 size = RPCRDMA_HDRLEN_MIN;94 size = RPCRDMA_HDRLEN_MIN;
95 95
96 /* Maximum Write list size */96 /* Maximum Write list size */
97 size = sizeof(__be32); /* segment count */97 size += sizeof(__be32); /* segment count */
98 size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);98 size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32);
99 size += sizeof(__be32); /* list discriminator */99 size += sizeof(__be32); /* list discriminator */
100 100

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t