@@ -3760,7 +3760,7 @@ smb2_echo_callback(struct mid_q_entry *mid)
{
struct TCP_Server_Info *server = mid->callback_data;
struct smb2_echo_rsp *rsp = (struct smb2_echo_rsp *)mid->resp_buf;
- struct cifs_credits credits = { .value = 0, .instance = 0 };
+ struct cifs_credits credits = { .value = 1, .instance = 0 };
if (mid->mid_state == MID_RESPONSE_RECEIVED
|| mid->mid_state == MID_RESPONSE_MALFORMED) {
@@ -4150,7 +4150,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
struct TCP_Server_Info *server = rdata->server;
struct smb2_hdr *shdr =
(struct smb2_hdr *)rdata->iov[0].iov_base;
- struct cifs_credits credits = { .value = 0, .instance = 0 };
+ struct cifs_credits credits = { .value = 1, .instance = 0 };
struct smb_rqst rqst = { .rq_iov = &rdata->iov[1], .rq_nvec = 1 };
if (rdata->got_bytes) {
@@ -4402,7 +4402,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
struct TCP_Server_Info *server = wdata->server;
unsigned int written;
struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf;
- struct cifs_credits credits = { .value = 0, .instance = 0 };
+ struct cifs_credits credits = { .value = 1, .instance = 0 };
WARN_ONCE(wdata->server != mid->server,
"wdata server %p != mid server %p",
Initialize credits.value to 1, which will be passed to add_credits() if mid->mid_state is not MID_RESPONSE_RECEIVED or MID_RESPONSE_MALFORMED. Signed-off-by: Winston Wen <wentao@uniontech.com> --- fs/smb/client/smb2pdu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)