mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 03:11:11 -04:00
cifs: change_conf needs to be called for session setup
Today we skip calling change_conf for negotiates and session setup requests. This can be a problem for mchan as the immediate next call after session setup could be due to an I/O that is made on the mount point. For single channel, this is not a problem as there will be several calls after setting up session. This change enforces calling change_conf when the total credits contain enough for reservations for echoes and oplocks. We expect this to happen during the last session setup response. This way, echoes and oplocks are not disabled before the first request to the server. So if that first request is an open, it does not need to disable requesting leases. Cc: <stable@vger.kernel.org> Reviewed-by: Bharath SM <bharathsm@microsoft.com> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
committed by
Steve French
parent
8e13b1b409
commit
c208a2b958
@@ -111,10 +111,21 @@ smb2_add_credits(struct TCP_Server_Info *server,
|
||||
cifs_trace_rw_credits_zero_in_flight);
|
||||
}
|
||||
server->in_flight--;
|
||||
|
||||
/*
|
||||
* Rebalance credits when an op drains in_flight. For session setup,
|
||||
* do this only when the total accumulated credits are high enough (>2)
|
||||
* so that a newly established secondary channel can reserve credits for
|
||||
* echoes and oplocks. We expect this to happen at the end of the final
|
||||
* session setup response.
|
||||
*/
|
||||
if (server->in_flight == 0 &&
|
||||
((optype & CIFS_OP_MASK) != CIFS_NEG_OP) &&
|
||||
((optype & CIFS_OP_MASK) != CIFS_SESS_OP))
|
||||
rc = change_conf(server);
|
||||
else if (server->in_flight == 0 &&
|
||||
((optype & CIFS_OP_MASK) == CIFS_SESS_OP) && *val > 2)
|
||||
rc = change_conf(server);
|
||||
/*
|
||||
* Sometimes server returns 0 credits on oplock break ack - we need to
|
||||
* rebalance credits in this case.
|
||||
|
||||
Reference in New Issue
Block a user