Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 368e3585 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov
Browse files

ceph: call __fscache_uncache_page() if readpages fails



If readpages fails, fscache needs to cleanup its internal state.

Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 480ce08a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -276,8 +276,10 @@ static void finish_read(struct ceph_osd_request *req)
	for (i = 0; i < num_pages; i++) {
		struct page *page = osd_data->pages[i];

		if (rc < 0 && rc != -ENOENT)
		if (rc < 0 && rc != -ENOENT) {
			ceph_fscache_readpage_cancel(inode, page);
			goto unlock;
		}
		if (bytes < (int)PAGE_SIZE) {
			/* zero (remainder of) page */
			int s = bytes < 0 ? 0 : bytes;