ceph: fix race during filling readdir cache
authorYan, Zheng <zyan@redhat.com>
Fri, 26 Feb 2016 08:27:13 +0000 (16:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:23:42 +0000 (15:23 +0200)
commitf0006eda8e69571fcd8bd657d9c89f30e211e038
tree647c6a8a885f6e4bbf6aa8159a7c9fc5f4857139
parent9ec153066b081132edb59998c7030f1fb1bd62a8
ceph: fix race during filling readdir cache

commit af5e5eb574776cdf1b756a27cc437bff257e22fe upstream.

Readdir cache uses page cache to save dentry pointers. When adding
dentry pointers to middle of a page, we need to make sure the page
already exists. Otherwise the beginning part of the page will be
invalid pointers.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Cc: Nikolay Borisov <kernel@kyup.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/inode.c