summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2015-09-07 15:46:24 +0800
committerIlya Dryomov <idryomov@gmail.com>2015-09-09 09:52:29 +0300
commit438386853d4c0c48fe73bf05a7d61c70ca5a3bfb (patch)
treeb760a610262df0e202e949cbb3b6f71726ff2c38 /fs/ceph
parent55b0b31cbc09f80db384671e22cdc94b2aa26b29 (diff)
downloadtalos-op-linux-438386853d4c0c48fe73bf05a7d61c70ca5a3bfb.tar.gz
talos-op-linux-438386853d4c0c48fe73bf05a7d61c70ca5a3bfb.zip
ceph: improve readahead for file holes
When readahead encounters file holes, osd reply returns error -ENOENT, finish_read() skips adding pages to the the page cache. So readahead does not work for file holes. The fix is adding zero pages to the page cache when -ENOENT is returned. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/addr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 98933350331c..6471e28e0586 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -276,7 +276,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
for (i = 0; i < num_pages; i++) {
struct page *page = osd_data->pages[i];
- if (rc < 0)
+ if (rc < 0 && rc != ENOENT)
goto unlock;
if (bytes < (int)PAGE_CACHE_SIZE) {
/* zero (remainder of) page */
OpenPOWER on IntegriCloud