Pārlūkot izejas kodu

ceph fscache: Uncaching no data page from fscache in readpage()

Currently, if one new page allocated into fscache in readpage(), however,
with no data read into due to error encountered during reading from OSDs,
the slot in fscache is not uncached. This patch fixes this.

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Milosz Tanski <milosz@adfin.com>
Li Wang 12 gadi atpakaļ
vecāks
revīzija
183028052b
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      fs/ceph/addr.c

+ 1 - 0
fs/ceph/addr.c

@@ -209,6 +209,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
 		err = 0;
 		err = 0;
 	if (err < 0) {
 	if (err < 0) {
 		SetPageError(page);
 		SetPageError(page);
+		ceph_fscache_readpage_cancel(inode, page);
 		goto out;
 		goto out;
 	} else {
 	} else {
 		if (err < PAGE_CACHE_SIZE) {
 		if (err < PAGE_CACHE_SIZE) {