From a8673d61ad77ddf2118599507bd40cc345e95368 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 18 Feb 2013 16:38:14 +0800 Subject: 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 Reviewed-by: Greg Farnum Reviewed-by: Sage Weil --- fs/ceph/mds_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/ceph/mds_client.c') diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index fb7cb05d8ab..56da380878c 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2029,7 +2029,7 @@ out: } /* - * Invalidate dir D_COMPLETE, dentry lease state on an aborted MDS + * Invalidate dir I_COMPLETE, dentry lease state on an aborted MDS * namespace request. */ void ceph_invalidate_dir_request(struct ceph_mds_request *req) @@ -2037,9 +2037,9 @@ void ceph_invalidate_dir_request(struct ceph_mds_request *req) struct inode *inode = req->r_locked_dir; struct ceph_inode_info *ci = ceph_inode(inode); - dout("invalidate_dir_request %p (D_COMPLETE, lease(s))\n", inode); + dout("invalidate_dir_request %p (I_COMPLETE, lease(s))\n", inode); spin_lock(&ci->i_ceph_lock); - ceph_dir_clear_complete(inode); + ci->i_ceph_flags &= ~CEPH_I_COMPLETE; ci->i_release_count++; spin_unlock(&ci->i_ceph_lock); -- cgit v1.2.3-70-g09d2