CIFS: Fix leaking locked VFS cache pages in writeback retry
authorPavel Shilovsky <pshilov@microsoft.com>
Wed, 30 Jan 2019 00:40:28 +0000 (16:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2019 06:22:09 +0000 (08:22 +0200)
commit778d626c6af3c6f98166ae3da6f2f11991f15160
tree57290dfc2db1135e5584884815b60b8f70f151d2
parentfb2dabeabb175afcebc37561c8992732278fa8c0
CIFS: Fix leaking locked VFS cache pages in writeback retry

[ Upstream commit 165df9a080b6863ae286fa01780c13d87cd81076 ]

If we don't find a writable file handle when retrying writepages
we break of the loop and do not unlock and put pages neither from
wdata2 nor from the original wdata. Fix this by walking through
all the remaining pages and cleanup them properly.

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