Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210058
b: refs/heads/master
c: b545787
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and Sage Weil committed Aug 26, 2010
1 parent 0e20bb8 commit 07cb6c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: e072f8aa3587710cd35cce0f6b6efd7b4276c327
refs/heads/master: b545787dbb00a041c541a4759d938ddb0108295a
15 changes: 9 additions & 6 deletions trunk/fs/ceph/auth_x.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static void ceph_x_validate_tickets(struct ceph_auth_client *ac, int *pneed)

th = get_ticket_handler(ac, service);

if (!th) {
if (IS_ERR(th)) {
*pneed |= service;
continue;
}
Expand All @@ -399,6 +399,9 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,
struct ceph_x_ticket_handler *th =
get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH);

if (IS_ERR(th))
return PTR_ERR(th);

ceph_x_validate_tickets(ac, &need);

dout("build_request want %x have %x need %x\n",
Expand Down Expand Up @@ -450,7 +453,6 @@ static int ceph_x_build_request(struct ceph_auth_client *ac,
return -ERANGE;
head->op = cpu_to_le16(CEPHX_GET_PRINCIPAL_SESSION_KEY);

BUG_ON(!th);
ret = ceph_x_build_authorizer(ac, th, &xi->auth_authorizer);
if (ret)
return ret;
Expand Down Expand Up @@ -505,7 +507,8 @@ static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result,

case CEPHX_GET_PRINCIPAL_SESSION_KEY:
th = get_ticket_handler(ac, CEPH_ENTITY_TYPE_AUTH);
BUG_ON(!th);
if (IS_ERR(th))
return PTR_ERR(th);
ret = ceph_x_proc_ticket_reply(ac, &th->session_key,
buf + sizeof(*head), end);
break;
Expand Down Expand Up @@ -563,8 +566,8 @@ static int ceph_x_verify_authorizer_reply(struct ceph_auth_client *ac,
void *end = p + sizeof(au->reply_buf);

th = get_ticket_handler(ac, au->service);
if (!th)
return -EIO; /* hrm! */
if (IS_ERR(th))
return PTR_ERR(th);
ret = ceph_x_decrypt(&th->session_key, &p, end, &reply, sizeof(reply));
if (ret < 0)
return ret;
Expand Down Expand Up @@ -626,7 +629,7 @@ static void ceph_x_invalidate_authorizer(struct ceph_auth_client *ac,
struct ceph_x_ticket_handler *th;

th = get_ticket_handler(ac, peer_type);
if (th && !IS_ERR(th))
if (!IS_ERR(th))
remove_ticket_handler(ac, th);
}

Expand Down

0 comments on commit 07cb6c8

Please sign in to comment.