From: Yan, Zheng Date: Mon, 7 Sep 2015 07:46:24 +0000 (+0800) Subject: ceph: improve readahead for file holes X-Git-Tag: KARO-TX6UL-2015-11-03~118^2 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-linux.git;a=commitdiff_plain;h=8dbd263de1cba18100a9fb30fed606e6d7939b9d 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 --- 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 */