]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ceph: Don't add dirty inode to dirty list if caps is in migration
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 19 Nov 2012 02:49:07 +0000 (10:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:46:50 +0000 (08:46 -0800)
(cherry picked from commit 0685235ffd9dbdb9ccbda587f8a3c83ad1d5a921)

Add dirty inode to cap_dirty_migrating list instead, this can avoid
ceph_flush_dirty_caps() entering infinite loop.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/caps.c

index c633d1d728b38ff609d98b1543970f54eeae670a..cac471814f47a0d3e8b5d5afd26b53d3da421b58 100644 (file)
@@ -1349,11 +1349,15 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
                if (!ci->i_head_snapc)
                        ci->i_head_snapc = ceph_get_snap_context(
                                ci->i_snap_realm->cached_context);
-               dout(" inode %p now dirty snapc %p\n", &ci->vfs_inode,
-                       ci->i_head_snapc);
+               dout(" inode %p now dirty snapc %p auth cap %p\n",
+                    &ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap);
                BUG_ON(!list_empty(&ci->i_dirty_item));
                spin_lock(&mdsc->cap_dirty_lock);
-               list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
+               if (ci->i_auth_cap)
+                       list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
+               else
+                       list_add(&ci->i_dirty_item,
+                                &mdsc->cap_dirty_migrating);
                spin_unlock(&mdsc->cap_dirty_lock);
                if (ci->i_flushing_caps == 0) {
                        ihold(inode);