diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-02-18 03:38:14 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:14:33 -0400 |
commit | a8673d61ad77ddf2118599507bd40cc345e95368 (patch) | |
tree | 0b8688fee3c2f6c7c35db75d42edd806df689d1d /fs/ceph/caps.c | |
parent | 964266cce94cee7e4aca42994fcda206c111e917 (diff) |
ceph: use I_COMPLETE inode flag instead of D_COMPLETE flag
commit c6ffe10015 moved the flag that tracks if the dcache contents
for a directory are complete to dentry. The problem is there are
lots of places that use ceph_dir_{set,clear,test}_complete() while
holding i_ceph_lock. but ceph_dir_{set,clear,test}_complete() may
sleep because they call dput().
This patch basically reverts that commit. For ceph_d_prune(), it's
called with both the dentry to prune and the parent dentry are
locked. So it's safe to access the parent dentry's d_inode and
clear I_COMPLETE flag.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r-- | fs/ceph/caps.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index ea1f177739b2..bc575a4a813e 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -490,15 +490,17 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap, | |||
490 | ci->i_rdcache_gen++; | 490 | ci->i_rdcache_gen++; |
491 | 491 | ||
492 | /* | 492 | /* |
493 | * if we are newly issued FILE_SHARED, clear D_COMPLETE; we | 493 | * if we are newly issued FILE_SHARED, clear I_COMPLETE; we |
494 | * don't know what happened to this directory while we didn't | 494 | * don't know what happened to this directory while we didn't |
495 | * have the cap. | 495 | * have the cap. |
496 | */ | 496 | */ |
497 | if ((issued & CEPH_CAP_FILE_SHARED) && | 497 | if ((issued & CEPH_CAP_FILE_SHARED) && |
498 | (had & CEPH_CAP_FILE_SHARED) == 0) { | 498 | (had & CEPH_CAP_FILE_SHARED) == 0) { |
499 | ci->i_shared_gen++; | 499 | ci->i_shared_gen++; |
500 | if (S_ISDIR(ci->vfs_inode.i_mode)) | 500 | if (S_ISDIR(ci->vfs_inode.i_mode)) { |
501 | ceph_dir_clear_complete(&ci->vfs_inode); | 501 | dout(" marking %p NOT complete\n", &ci->vfs_inode); |
502 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | ||
503 | } | ||
502 | } | 504 | } |
503 | } | 505 | } |
504 | 506 | ||