Skip to content

Commit

Permalink
ceph: clean PgPrivate2 on returning from readpages
Browse files Browse the repository at this point in the history
In some cases the ceph readapages code code bails without filling all the pages
already marked by fscache. When we return back to readahead code this causes
a BUG.

Signed-off-by: Milosz Tanski <milosz@adfin.com>
  • Loading branch information
Milosz Tanski committed Sep 6, 2013
1 parent 99ccbd2 commit 76be778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
BUG_ON(rc == 0);
}
out:
ceph_fscache_readpages_cancel(inode, page_list);

dout("readpages %p file %p ret %d\n", inode, file, rc);
return rc;
}
Expand Down
7 changes: 7 additions & 0 deletions fs/ceph/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ static inline int ceph_release_fscache_page(struct page *page, gfp_t gfp)
return fscache_maybe_release_page(ci->fscache, page, gfp);
}

static inline void ceph_fscache_readpages_cancel(struct inode *inode,
struct list_head *pages)
{
struct ceph_inode_info *ci = ceph_inode(inode);
return fscache_readpages_cancel(ci->fscache, pages);
}

#else

static inline int ceph_fscache_register(void)
Expand Down

0 comments on commit 76be778

Please sign in to comment.