diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-03-23 23:36:08 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-20 11:55:36 -0400 |
commit | 571ade336ac89f5db602f7df992152e4f4b945bc (patch) | |
tree | f10c4a63d4f5c624c9a6ddcc4a0ca941583e3d30 /fs/ceph | |
parent | db40cc1702d6a7049740d269cf6c1a42f979c7a7 (diff) |
ceph: don't mark dirty caps when there is no auth cap
No i_auth_cap means reconnecting to MDS was denied. So don't
add new dirty caps.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 8 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 4ddadc13d162..37a42353b983 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1404,6 +1404,13 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask) | |||
1404 | int was = ci->i_dirty_caps; | 1404 | int was = ci->i_dirty_caps; |
1405 | int dirty = 0; | 1405 | int dirty = 0; |
1406 | 1406 | ||
1407 | if (!ci->i_auth_cap) { | ||
1408 | pr_warn("__mark_dirty_caps %p %llx mask %s, " | ||
1409 | "but no auth cap (session was closed?)\n", | ||
1410 | inode, ceph_ino(inode), ceph_cap_string(mask)); | ||
1411 | return 0; | ||
1412 | } | ||
1413 | |||
1407 | dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->vfs_inode, | 1414 | dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->vfs_inode, |
1408 | ceph_cap_string(mask), ceph_cap_string(was), | 1415 | ceph_cap_string(mask), ceph_cap_string(was), |
1409 | ceph_cap_string(was | mask)); | 1416 | ceph_cap_string(was | mask)); |
@@ -1414,7 +1421,6 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask) | |||
1414 | ci->i_snap_realm->cached_context); | 1421 | ci->i_snap_realm->cached_context); |
1415 | dout(" inode %p now dirty snapc %p auth cap %p\n", | 1422 | dout(" inode %p now dirty snapc %p auth cap %p\n", |
1416 | &ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap); | 1423 | &ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap); |
1417 | WARN_ON(!ci->i_auth_cap); | ||
1418 | BUG_ON(!list_empty(&ci->i_dirty_item)); | 1424 | BUG_ON(!list_empty(&ci->i_dirty_item)); |
1419 | spin_lock(&mdsc->cap_dirty_lock); | 1425 | spin_lock(&mdsc->cap_dirty_lock); |
1420 | list_add(&ci->i_dirty_item, &mdsc->cap_dirty); | 1426 | list_add(&ci->i_dirty_item, &mdsc->cap_dirty); |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 0122491d947c..0cfc2d163549 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -1098,7 +1098,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
1098 | cap, ci, &ci->vfs_inode); | 1098 | cap, ci, &ci->vfs_inode); |
1099 | spin_lock(&ci->i_ceph_lock); | 1099 | spin_lock(&ci->i_ceph_lock); |
1100 | __ceph_remove_cap(cap, false); | 1100 | __ceph_remove_cap(cap, false); |
1101 | if (!__ceph_is_any_real_caps(ci)) { | 1101 | if (!ci->i_auth_cap) { |
1102 | struct ceph_mds_client *mdsc = | 1102 | struct ceph_mds_client *mdsc = |
1103 | ceph_sb_to_client(inode->i_sb)->mdsc; | 1103 | ceph_sb_to_client(inode->i_sb)->mdsc; |
1104 | 1104 | ||