Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309470
b: refs/heads/master
c: a255651
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed May 17, 2012
1 parent b16bdcd commit 2975c69
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74f1869f76d043bad12ec03b4d5f04a8c3d1f157
refs/heads/master: a255651d4cad89f1a606edd36135af892ada4f20
14 changes: 6 additions & 8 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3406,16 +3406,14 @@ static int get_authorizer(struct ceph_connection *con,
int ret = 0;

if (force_new && auth->authorizer) {
ac->ops->destroy_authorizer(ac, auth->authorizer);
if (ac->ops && ac->ops->destroy_authorizer)
ac->ops->destroy_authorizer(ac, auth->authorizer);
auth->authorizer = NULL;
}
if (auth->authorizer == NULL) {
if (ac->ops->create_authorizer) {
ret = ac->ops->create_authorizer(ac,
CEPH_ENTITY_TYPE_MDS, auth);
if (ret)
return ret;
}
if (!auth->authorizer && ac->ops && ac->ops->create_authorizer) {
ret = ac->ops->create_authorizer(ac, CEPH_ENTITY_TYPE_MDS, auth);
if (ret)
return ret;
}

*proto = ac->protocol;
Expand Down
15 changes: 10 additions & 5 deletions trunk/net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,10 @@ static void put_osd(struct ceph_osd *osd)
{
dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref),
atomic_read(&osd->o_ref) - 1);
if (atomic_dec_and_test(&osd->o_ref)) {
if (atomic_dec_and_test(&osd->o_ref) && osd->o_auth.authorizer) {
struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;

if (osd->o_auth.authorizer)
if (ac->ops && ac->ops->destroy_authorizer)
ac->ops->destroy_authorizer(ac, osd->o_auth.authorizer);
kfree(osd);
}
Expand Down Expand Up @@ -2119,10 +2119,11 @@ static int get_authorizer(struct ceph_connection *con,
int ret = 0;

if (force_new && auth->authorizer) {
ac->ops->destroy_authorizer(ac, auth->authorizer);
if (ac->ops && ac->ops->destroy_authorizer)
ac->ops->destroy_authorizer(ac, auth->authorizer);
auth->authorizer = NULL;
}
if (auth->authorizer == NULL) {
if (!auth->authorizer && ac->ops && ac->ops->create_authorizer) {
ret = ac->ops->create_authorizer(ac, CEPH_ENTITY_TYPE_OSD, auth);
if (ret)
return ret;
Expand All @@ -2144,6 +2145,10 @@ static int verify_authorizer_reply(struct ceph_connection *con, int len)
struct ceph_osd_client *osdc = o->o_osdc;
struct ceph_auth_client *ac = osdc->client->monc.auth;

/*
* XXX If ac->ops or ac->ops->verify_authorizer_reply is null,
* XXX which do we do: succeed or fail?
*/
return ac->ops->verify_authorizer_reply(ac, o->o_auth.authorizer, len);
}

Expand All @@ -2153,7 +2158,7 @@ static int invalidate_authorizer(struct ceph_connection *con)
struct ceph_osd_client *osdc = o->o_osdc;
struct ceph_auth_client *ac = osdc->client->monc.auth;

if (ac->ops->invalidate_authorizer)
if (ac->ops && ac->ops->invalidate_authorizer)
ac->ops->invalidate_authorizer(ac, CEPH_ENTITY_TYPE_OSD);

return ceph_monc_validate_auth(&osdc->client->monc);
Expand Down

0 comments on commit 2975c69

Please sign in to comment.