CIFS: Try to acquire credits at once for compound requests
authorPavel Shilovsky <pshilov@microsoft.com>
Thu, 31 Jan 2019 00:58:09 +0000 (16:58 -0800)
committerSteve French <stfrench@microsoft.com>
Wed, 6 Mar 2019 00:10:04 +0000 (18:10 -0600)
commit7091bcaba9f34c83e1e6f418b6de5c6d987571da
tree44efa04e6ea14bb7f6eec84495cbda05f9ee0bc8
parentfe768d51c832ebde70a83221b0633dc7bc9640a6
CIFS: Try to acquire credits at once for compound requests

Currently we get one credit per compound part of the request
individually. This may lead to being stuck on waiting for credits
if multiple compounded operations happen in parallel. Try acquire
credits for all compound parts at once. Return immediately if not
enough credits and too few requests are in flight currently thus
narrowing the possibility of infinite waiting for credits.

The more advance fix is to return right away if not enough credits
for the compound request and do not look at the number of requests
in flight. The caller should handle such situations by falling back
to sequential execution of SMB commands instead of compounding.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/transport.c