Commit 8a61716f authored by Linus Torvalds's avatar Linus Torvalds

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
parents d6622d91 04242ff3
...@@ -616,7 +616,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, ...@@ -616,7 +616,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci,
capsnap->size); capsnap->size);
spin_lock(&mdsc->snap_flush_lock); spin_lock(&mdsc->snap_flush_lock);
list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); if (list_empty(&ci->i_snap_flush_item))
list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list);
spin_unlock(&mdsc->snap_flush_lock); spin_unlock(&mdsc->snap_flush_lock);
return 1; /* caller may want to ceph_flush_snaps */ return 1; /* caller may want to ceph_flush_snaps */
} }
......
...@@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con) ...@@ -2058,6 +2058,8 @@ static int process_connect(struct ceph_connection *con)
dout("process_connect on %p tag %d\n", con, (int)con->in_tag); dout("process_connect on %p tag %d\n", con, (int)con->in_tag);
if (con->auth) { if (con->auth) {
int len = le32_to_cpu(con->in_reply.authorizer_len);
/* /*
* Any connection that defines ->get_authorizer() * Any connection that defines ->get_authorizer()
* should also define ->add_authorizer_challenge() and * should also define ->add_authorizer_challenge() and
...@@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con) ...@@ -2067,8 +2069,7 @@ static int process_connect(struct ceph_connection *con)
*/ */
if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) {
ret = con->ops->add_authorizer_challenge( ret = con->ops->add_authorizer_challenge(
con, con->auth->authorizer_reply_buf, con, con->auth->authorizer_reply_buf, len);
le32_to_cpu(con->in_reply.authorizer_len));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con) ...@@ -2078,10 +2079,12 @@ static int process_connect(struct ceph_connection *con)
return 0; return 0;
} }
ret = con->ops->verify_authorizer_reply(con); if (len) {
if (ret < 0) { ret = con->ops->verify_authorizer_reply(con);
con->error_msg = "bad authorize reply"; if (ret < 0) {
return ret; con->error_msg = "bad authorize reply";
return ret;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment