diff mbox

[2/6] ceph: move dirty inode to migrating list when clearing auth caps

Message ID 1357299261-20591-3-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Jan. 4, 2013, 11:34 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 fs/ceph/caps.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Sage Weil Jan. 6, 2013, 6:05 a.m. UTC | #1
Reviewed-by: Sage Weil <sage@inktank.com>

On Fri, 4 Jan 2013, Yan, Zheng wrote:

> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  fs/ceph/caps.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index a1d9bb3..a9fe2d5 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -611,8 +611,16 @@ retry:
>  
>  	if (flags & CEPH_CAP_FLAG_AUTH)
>  		ci->i_auth_cap = cap;
> -	else if (ci->i_auth_cap == cap)
> +	else if (ci->i_auth_cap == cap) {
>  		ci->i_auth_cap = NULL;
> +		spin_lock(&mdsc->cap_dirty_lock);
> +		if (!list_empty(&ci->i_dirty_item)) {
> +			dout(" moving %p to cap_dirty_migrating\n", inode);
> +			list_move(&ci->i_dirty_item,
> +				  &mdsc->cap_dirty_migrating);
> +		}
> +		spin_unlock(&mdsc->cap_dirty_lock);
> +	}
>  
>  	dout("add_cap inode %p (%llx.%llx) cap %p %s now %s seq %d mds%d\n",
>  	     inode, ceph_vinop(inode), cap, ceph_cap_string(issued),
> -- 
> 1.7.11.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index a1d9bb3..a9fe2d5 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -611,8 +611,16 @@  retry:
 
 	if (flags & CEPH_CAP_FLAG_AUTH)
 		ci->i_auth_cap = cap;
-	else if (ci->i_auth_cap == cap)
+	else if (ci->i_auth_cap == cap) {
 		ci->i_auth_cap = NULL;
+		spin_lock(&mdsc->cap_dirty_lock);
+		if (!list_empty(&ci->i_dirty_item)) {
+			dout(" moving %p to cap_dirty_migrating\n", inode);
+			list_move(&ci->i_dirty_item,
+				  &mdsc->cap_dirty_migrating);
+		}
+		spin_unlock(&mdsc->cap_dirty_lock);
+	}
 
 	dout("add_cap inode %p (%llx.%llx) cap %p %s now %s seq %d mds%d\n",
 	     inode, ceph_vinop(inode), cap, ceph_cap_string(issued),