diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-11-29 23:47:41 -0500 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-01-21 00:29:33 -0500 |
commit | 9215aeea622fec7ca8123c6bd6f03a1753e2b0b3 (patch) | |
tree | 00c4aaae67c7891553f8331b6e0b6e54bf95d08f /fs/ceph/caps.c | |
parent | ca18bede048e95a749d13410ce1da4ad0ffa7938 (diff) |
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.c | 12 |
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) | |||
891 | return !RB_EMPTY_ROOT(&ci->i_caps) || ci->i_cap_exporting_mds >= 0; | 891 | return !RB_EMPTY_ROOT(&ci->i_caps) || ci->i_cap_exporting_mds >= 0; |
892 | } | 892 | } |
893 | 893 | ||
894 | int ceph_is_any_caps(struct inode *inode) | ||
895 | { | ||
896 | struct ceph_inode_info *ci = ceph_inode(inode); | ||
897 | int ret; | ||
898 | |||
899 | spin_lock(&ci->i_ceph_lock); | ||
900 | ret = __ceph_is_any_caps(ci); | ||
901 | spin_unlock(&ci->i_ceph_lock); | ||
902 | |||
903 | return ret; | ||
904 | } | ||
905 | |||
894 | /* | 906 | /* |
895 | * Remove a cap. Take steps to deal with a racing iterate_session_caps. | 907 | * Remove a cap. Take steps to deal with a racing iterate_session_caps. |
896 | * | 908 | * |