aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-11-18 21:49:07 -0500
committerAlex Elder <elder@inktank.com>2012-12-13 09:13:08 -0500
commit0685235ffd9dbdb9ccbda587f8a3c83ad1d5a921 (patch)
tree3a8e52d05e8e2f6ef5a270369c460588452a8f33 /fs/ceph
parented75ec2cd19b47efcd292b6e23f58e56f4c5bc34 (diff)
ceph: Don't add dirty inode to dirty list if caps is in migration
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 8072aefc427c..5efa3f5e2f77 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1351,11 +1351,15 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
1351 if (!ci->i_head_snapc) 1351 if (!ci->i_head_snapc)
1352 ci->i_head_snapc = ceph_get_snap_context( 1352 ci->i_head_snapc = ceph_get_snap_context(
1353 ci->i_snap_realm->cached_context); 1353 ci->i_snap_realm->cached_context);
1354 dout(" inode %p now dirty snapc %p\n", &ci->vfs_inode, 1354 dout(" inode %p now dirty snapc %p auth cap %p\n",
1355 ci->i_head_snapc); 1355 &ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap);
1356 BUG_ON(!list_empty(&ci->i_dirty_item)); 1356 BUG_ON(!list_empty(&ci->i_dirty_item));
1357 spin_lock(&mdsc->cap_dirty_lock); 1357 spin_lock(&mdsc->cap_dirty_lock);
1358 list_add(&ci->i_dirty_item, &mdsc->cap_dirty); 1358 if (ci->i_auth_cap)
1359 list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
1360 else
1361 list_add(&ci->i_dirty_item,
1362 &mdsc->cap_dirty_migrating);
1359 spin_unlock(&mdsc->cap_dirty_lock); 1363 spin_unlock(&mdsc->cap_dirty_lock);
1360 if (ci->i_flushing_caps == 0) { 1364 if (ci->i_flushing_caps == 0) {
1361 ihold(inode); 1365 ihold(inode);