summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-12 15:07:24 -0800
committerSage Weil <sage@newdream.net>2009-11-12 15:57:05 -0800
commit11ea8eda064aa4dc6e44a6dade1891b69ebd5255 (patch)
treee7def548d1d80e38710cc7d1fe30d4b2cd37d56f
parent039934b895c89c2bb40aa5132efe00e60b70efca (diff)
ceph: fix page invalidation deadlock
We occasionally want to make a best-effort attempt to invalidate cache pages without fear of blocking. If this fails, we fall back to an async invalidate in another thread. Use invalidate_mapping_pages instead of invalidate_inode_page2, as that will skip locked pages, and not deadlock. Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--fs/ceph/caps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index d8132b6e770..9dd110602cd 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1440,7 +1440,7 @@ retry_locked:
dout("check_caps trying to invalidate on %p\n", inode);
spin_unlock(&inode->i_lock);
- ret = invalidate_inode_pages2(&inode->i_data);
+ ret = invalidate_mapping_pages(&inode->i_data, 0, -1);
spin_lock(&inode->i_lock);
if (ret == 0 && invalidating_gen == ci->i_rdcache_gen) {
/* success. */
@@ -2180,7 +2180,7 @@ restart:
spin_unlock(&inode->i_lock);
tried_invalidate = 1;
- ret = invalidate_inode_pages2(&inode->i_data);
+ ret = invalidate_mapping_pages(&inode->i_data, 0, -1);
spin_lock(&inode->i_lock);
if (ret < 0) {
/* there were locked pages.. invalidate later