]> git.baikalelectronics.ru Git - kernel.git/commit
CIFS: Fix possible hang during async MTU reads and writes
authorPavel Shilovsky <pshilov@microsoft.com>
Thu, 17 Jan 2019 16:21:24 +0000 (08:21 -0800)
committerSteve French <stfrench@microsoft.com>
Thu, 24 Jan 2019 15:37:33 +0000 (09:37 -0600)
commita2f7b105bffb934e93b29bb6c4f1abda5683aaf7
tree3bde0b3fc30d32128dfa71787feaa22f26bc414b
parentca43d9966eeb664ee5daa47f92cdd114715292c8
CIFS: Fix possible hang during async MTU reads and writes

When doing MTU i/o we need to leave some credits for
possible reopen requests and other operations happening
in parallel. Currently we leave 1 credit which is not
enough even for reopen only: we need at least 2 credits
if durable handle reconnect fails. Also there may be
other operations at the same time including compounding
ones which require 3 credits at a time each. Fix this
by leaving 8 credits which is big enough to cover most
scenarios.

Was able to reproduce this when server was configured
to give out fewer credits than usual.

The proper fix would be to reconnect a file handle first
and then obtain credits for an MTU request but this leads
to bigger code changes and should happen in other patches.

Cc: <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c