summaryrefslogtreecommitdiff
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-11-30 08:47:41 +0400
committerYan, Zheng <zheng.z.yan@intel.com>2014-01-21 09:29:33 +0400
commit9215aeea622fec7ca8123c6bd6f03a1753e2b0b3 (patch)
tree00c4aaae67c7891553f8331b6e0b6e54bf95d08f /fs/ceph/caps.c
parentca18bede048e95a749d13410ce1da4ad0ffa7938 (diff)
downloadlinux-9215aeea622fec7ca8123c6bd6f03a1753e2b0b3.tar.xz
ceph: check inode caps in ceph_d_revalidate
Some inodes in readdir reply may have no caps. Getattr mds request for these inodes can return -ESTALE. The fix is consider dentry that links to inode with no caps as invalid. Invalid dentry causes a lookup request to send to the mds, the MDS will send caps back. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index d2154d63f671..d65ff334901c 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -891,6 +891,18 @@ static int __ceph_is_any_caps(struct ceph_inode_info *ci)
return !RB_EMPTY_ROOT(&ci->i_caps) || ci->i_cap_exporting_mds >= 0;
}
+int ceph_is_any_caps(struct inode *inode)
+{
+ struct ceph_inode_info *ci = ceph_inode(inode);
+ int ret;
+
+ spin_lock(&ci->i_ceph_lock);
+ ret = __ceph_is_any_caps(ci);
+ spin_unlock(&ci->i_ceph_lock);
+
+ return ret;
+}
+
/*
* Remove a cap. Take steps to deal with a racing iterate_session_caps.
*