]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ceph: track read contexts in ceph_file_info
authorYan, Zheng <zyan@redhat.com>
Tue, 24 Jul 2018 03:18:00 +0000 (05:18 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:28 +0000 (12:30 +0200)
commit3bd4d543726ddbb9d98ea76029c41df2a6e34c2e
treecdbc615f6eb738cfe0b62af5dc171d233af58d2f
parenta35c09dd2543f215809851dfc04b2b601de9d649
ceph: track read contexts in ceph_file_info

BugLink: https://bugs.launchpad.net/bugs/1783246
Previously ceph_read_iter() uses current->journal to pass context info
to ceph_readpages(), so that ceph_readpages() can distinguish read(2)
from readahead(2)/fadvise(2)/madvise(2). The problem is that page fault
can happen when copying data to userspace memory. Page fault may call
other filesystem's page_mkwrite() if the userspace memory is mapped to a
file. The later filesystem may also want to use current->journal.

The fix is define a on-stack data structure in ceph_read_iter(), add it
to context list in ceph_file_info. ceph_readpages() searches the list,
find if there is a context belongs to current thread.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 5d988308283ecf062fa88f20ae05c52cce0bcdca)
Signed-off-by: Daniel Axtens <daniel.axtens@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ceph/addr.c
fs/ceph/file.c
fs/ceph/super.h