CIFS: Do not miss cancelled OPEN responses
authorPavel Shilovsky <pshilov@microsoft.com>
Thu, 21 Nov 2019 19:35:14 +0000 (11:35 -0800)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Nov 2019 07:14:53 +0000 (01:14 -0600)
commit7b71843fa7028475b052107664cbe120156a2cfc
tree01de54f71dde647272b02b670f5e3a130b65e340
parent86a7964be7afaf3df6b64faaa10a7032d2444e51
CIFS: Do not miss cancelled OPEN responses

When an OPEN command is cancelled we mark a mid as
cancelled and let the demultiplex thread process it
by closing an open handle. The problem is there is
a race between a system call thread and the demultiplex
thread and there may be a situation when the mid has
been already processed before it is set as cancelled.

Fix this by processing cancelled requests when mids
are being destroyed which means that there is only
one thread referencing a particular mid. Also set
mids as cancelled unconditionally on their state.

Cc: Stable <stable@vger.kernel.org>
Tested-by: Frank Sorenson <sorenson@redhat.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c
fs/cifs/transport.c