mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 05:44:31 +08:00
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>
This commit is contained in:
parent
db40cc1702
commit
571ade336a
@ -1404,6 +1404,13 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
|
|||||||
int was = ci->i_dirty_caps;
|
int was = ci->i_dirty_caps;
|
||||||
int dirty = 0;
|
int dirty = 0;
|
||||||
|
|
||||||
|
if (!ci->i_auth_cap) {
|
||||||
|
pr_warn("__mark_dirty_caps %p %llx mask %s, "
|
||||||
|
"but no auth cap (session was closed?)\n",
|
||||||
|
inode, ceph_ino(inode), ceph_cap_string(mask));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->vfs_inode,
|
dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->vfs_inode,
|
||||||
ceph_cap_string(mask), ceph_cap_string(was),
|
ceph_cap_string(mask), ceph_cap_string(was),
|
||||||
ceph_cap_string(was | mask));
|
ceph_cap_string(was | mask));
|
||||||
@ -1414,7 +1421,6 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
|
|||||||
ci->i_snap_realm->cached_context);
|
ci->i_snap_realm->cached_context);
|
||||||
dout(" inode %p now dirty snapc %p auth cap %p\n",
|
dout(" inode %p now dirty snapc %p auth cap %p\n",
|
||||||
&ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap);
|
&ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap);
|
||||||
WARN_ON(!ci->i_auth_cap);
|
|
||||||
BUG_ON(!list_empty(&ci->i_dirty_item));
|
BUG_ON(!list_empty(&ci->i_dirty_item));
|
||||||
spin_lock(&mdsc->cap_dirty_lock);
|
spin_lock(&mdsc->cap_dirty_lock);
|
||||||
list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
|
list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
|
||||||
|
@ -1098,7 +1098,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
|
|||||||
cap, ci, &ci->vfs_inode);
|
cap, ci, &ci->vfs_inode);
|
||||||
spin_lock(&ci->i_ceph_lock);
|
spin_lock(&ci->i_ceph_lock);
|
||||||
__ceph_remove_cap(cap, false);
|
__ceph_remove_cap(cap, false);
|
||||||
if (!__ceph_is_any_real_caps(ci)) {
|
if (!ci->i_auth_cap) {
|
||||||
struct ceph_mds_client *mdsc =
|
struct ceph_mds_client *mdsc =
|
||||||
ceph_sb_to_client(inode->i_sb)->mdsc;
|
ceph_sb_to_client(inode->i_sb)->mdsc;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user