Commit 93afd449 authored by Sage Weil's avatar Sage Weil

ceph: only invalidate on check_caps if we actually have pages

The i_rdcache_gen value only implies we MAY have cached pages; actually
check the mapping to see if it's worth bothering with an invalidate.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 4c32f5dd
...@@ -1534,7 +1534,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, ...@@ -1534,7 +1534,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
*/ */
if ((!is_delayed || mdsc->stopping) && if ((!is_delayed || mdsc->stopping) &&
ci->i_wrbuffer_ref == 0 && /* no dirty pages... */ ci->i_wrbuffer_ref == 0 && /* no dirty pages... */
ci->i_rdcache_gen && /* may have cached pages */ inode->i_data.nrpages && /* have cached pages */
(file_wanted == 0 || /* no open files */ (file_wanted == 0 || /* no open files */
(revoking & (CEPH_CAP_FILE_CACHE| (revoking & (CEPH_CAP_FILE_CACHE|
CEPH_CAP_FILE_LAZYIO))) && /* or revoking cache */ CEPH_CAP_FILE_LAZYIO))) && /* or revoking cache */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment