Skip to content

Commit 8a61716

Browse files
committed
Merge tag 'ceph-for-5.0-rc8' of git://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov: "Two bug fixes for old issues, both marked for stable" * tag 'ceph-for-5.0-rc8' of git://github.com/ceph/ceph-client: ceph: avoid repeatedly adding inode to mdsc->snap_flush_list libceph: handle an empty authorize reply
2 parents d6622d9 + 04242ff commit 8a61716

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

fs/ceph/snap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci,
616616
capsnap->size);
617617

618618
spin_lock(&mdsc->snap_flush_lock);
619-
list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list);
619+
if (list_empty(&ci->i_snap_flush_item))
620+
list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list);
620621
spin_unlock(&mdsc->snap_flush_lock);
621622
return 1; /* caller may want to ceph_flush_snaps */
622623
}

net/ceph/messenger.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con)
20582058
dout("process_connect on %p tag %d\n", con, (int)con->in_tag);
20592059

20602060
if (con->auth) {
2061+
int len = le32_to_cpu(con->in_reply.authorizer_len);
2062+
20612063
/*
20622064
* Any connection that defines ->get_authorizer()
20632065
* should also define ->add_authorizer_challenge() and
@@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con)
20672069
*/
20682070
if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) {
20692071
ret = con->ops->add_authorizer_challenge(
2070-
con, con->auth->authorizer_reply_buf,
2071-
le32_to_cpu(con->in_reply.authorizer_len));
2072+
con, con->auth->authorizer_reply_buf, len);
20722073
if (ret < 0)
20732074
return ret;
20742075

@@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con)
20782079
return 0;
20792080
}
20802081

2081-
ret = con->ops->verify_authorizer_reply(con);
2082-
if (ret < 0) {
2083-
con->error_msg = "bad authorize reply";
2084-
return ret;
2082+
if (len) {
2083+
ret = con->ops->verify_authorizer_reply(con);
2084+
if (ret < 0) {
2085+
con->error_msg = "bad authorize reply";
2086+
return ret;
2087+
}
20852088
}
20862089
}
20872090

0 commit comments

Comments
 (0)