]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
CIFS: Fix splice read for non-cached files
authorPavel Shilovsky <pshilov@microsoft.com>
Thu, 19 Jan 2017 21:53:15 +0000 (13:53 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 13 Mar 2017 21:20:54 +0000 (15:20 -0600)
commit91e0bc231805a4d47d620f0c0085f74f6f6030aa
tree03c141969cfb1281937a1c251f8d304e7c9dbbd3
parent929181af173ed01828209c2b6110b4745f303250
CIFS: Fix splice read for non-cached files

BugLink: http://bugs.launchpad.net/bugs/1672544
commit 9c25702cee1405099f982894c865c163de7909a8 upstream.

Currently we call copy_page_to_iter() for uncached reading into a pipe.
This is wrong because it treats pages as VFS cache pages and copies references
rather than actual data. When we are trying to read from the pipe we end up
calling page_cache_pipe_buf_confirm() which returns -ENODATA. This error
is translated into 0 which is returned to a user.

This issue is reproduced by running xfs-tests suite (generic test #249)
against mount points with "cache=none". Fix it by mapping pages manually
and calling copy_to_iter() that copies data into the pipe.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/cifs/file.c