]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: use the correct length when pinning memory for direct I/O for write
authorLong Li <longli@microsoft.com>
Sun, 16 Dec 2018 23:17:04 +0000 (23:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:46:03 +0000 (17:46 +0100)
commitd9d01620ae79b26ae4e5b021c2fb36005ae05864
tree2e4cee81e6ad5f35354bc035a64d735e465459be
parent22d99eb586eefb243f0e0959ff6ad6e507d266fc
CIFS: use the correct length when pinning memory for direct I/O for write

commit b6bc8a7b993e62f82415a5e3e4a6469e80fea19c upstream.

The current code attempts to pin memory using the largest possible wsize
based on the currect SMB credits. This doesn't cause kernel oops but this
is not optimal as we may pin more pages then actually needed.

Fix this by only pinning what are needed for doing this write I/O.

Signed-off-by: Long Li <longli@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Joey Pabalinas <joeypabalinas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/file.c