cifs: only wake the thread for the very last PDU in a compound
authorRonnie Sahlberg <lsahlber@redhat.com>
Thu, 30 Aug 2018 00:13:00 +0000 (10:13 +1000)
committerSteve French <stfrench@microsoft.com>
Tue, 2 Oct 2018 23:53:57 +0000 (18:53 -0500)
commit4e34feb5e96328df6a362c88098502b07c1b1e69
treee3766df6003a1b9f6e2084bc2266a6cafcd2e5cf
parentddf83afb9f60ee58cdec30bb615eff65d00ba05e
cifs: only wake the thread for the very last PDU in a compound

For compounded PDUs we whould only wake the waiting thread for the
very last PDU of the compound.
We do this so that we are guaranteed that the demultiplex_thread will
not process or access any of those MIDs any more once the send/recv
thread starts processing.

Else there is a race where at the end of the send/recv processing we
will try to delete all the mids of the compound. If the multiplex
thread still has other mids to process at this point for this compound
this can lead to an oops.

Needed to fix recent commit:
commit 730928c8f4be88e9d6a027a16b1e8fa9c59fc077
("cifs: update smb2_queryfs() to use compounding")

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