Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e130fde
)
gss: be albe to parse signed int when lsvcgssd send error downcall; some
author
ericm
<ericm>
Thu, 9 Jun 2005 21:58:50 +0000
(21:58 +0000)
committer
ericm
<ericm>
Thu, 9 Jun 2005 21:58:50 +0000
(21:58 +0000)
code adjustment.
lustre/sec/gss/svcsec_gss.c
patch
|
blob
|
history
diff --git
a/lustre/sec/gss/svcsec_gss.c
b/lustre/sec/gss/svcsec_gss.c
index
c5e2ddb
..
120348b
100644
(file)
--- a/
lustre/sec/gss/svcsec_gss.c
+++ b/
lustre/sec/gss/svcsec_gss.c
@@
-129,6
+129,7
@@
static void rsi_put(struct cache_head *item, struct cache_detail *cd)
struct rsi *rsii = container_of(item, struct rsi, h);
LASSERT(atomic_read(&item->refcnt) > 0);
if (cache_put(item, cd)) {
struct rsi *rsii = container_of(item, struct rsi, h);
LASSERT(atomic_read(&item->refcnt) > 0);
if (cache_put(item, cd)) {
+ LASSERT(item->next == NULL);
rsi_free(rsii);
OBD_FREE(rsii, sizeof(*rsii));
}
rsi_free(rsii);
OBD_FREE(rsii, sizeof(*rsii));
}
@@
-282,69
+283,67
@@
static int rsi_parse(struct cache_detail *cd,
ENTRY;
OBD_ALLOC(rsii, sizeof(*rsii));
ENTRY;
OBD_ALLOC(rsii, sizeof(*rsii));
- if (!rsii) {
- CERROR("failed to alloc rsii\n");
+ if (!rsii)
RETURN(-ENOMEM);
RETURN(-ENOMEM);
- }
cache_init(&rsii->h);
/* handle */
len = qword_get(&mesg, buf, mlen);
if (len < 0)
goto out;
cache_init(&rsii->h);
/* handle */
len = qword_get(&mesg, buf, mlen);
if (len < 0)
goto out;
- status = -ENOMEM;
- if (rawobj_alloc(&rsii->in_handle, buf, len))
+ if (rawobj_alloc(&rsii->in_handle, buf, len)) {
+ status = -ENOMEM;
goto out;
goto out;
+ }
/* token */
len = qword_get(&mesg, buf, mlen);
/* token */
len = qword_get(&mesg, buf, mlen);
- status = -EINVAL;
if (len < 0)
if (len < 0)
- goto out;;
- status = -ENOMEM;
- if (rawobj_alloc(&rsii->in_token, buf, len))
goto out;
goto out;
+ if (rawobj_alloc(&rsii->in_token, buf, len)) {
+ status = -ENOMEM;
+ goto out;
+ }
/* expiry */
expiry = get_expiry(&mesg);
/* expiry */
expiry = get_expiry(&mesg);
- status = -EINVAL;
if (expiry == 0)
goto out;
if (expiry == 0)
goto out;
- /* major
/minor
*/
+ /* major */
len = qword_get(&mesg, buf, mlen);
len = qword_get(&mesg, buf, mlen);
- if (len < 0)
+ if (len <
=
0)
goto out;
goto out;
- if (len == 0) {
+ rsii->major_status = simple_strtol(buf, &ep, 10);
+ if (*ep)
goto out;
goto out;
- } else {
- rsii->major_status = simple_strtoul(buf, &ep, 10);
- if (*ep)
- goto out;
- len = qword_get(&mesg, buf, mlen);
- if (len <= 0)
- goto out;
- rsii->minor_status = simple_strtoul(buf, &ep, 10);
- if (*ep)
- goto out;
- /* out_handle */
- len = qword_get(&mesg, buf, mlen);
- if (len < 0)
- goto out;
+ /* minor */
+ len = qword_get(&mesg, buf, mlen);
+ if (len <= 0)
+ goto out;
+ rsii->minor_status = simple_strtol(buf, &ep, 10);
+ if (*ep)
+ goto out;
+
+ /* out_handle */
+ len = qword_get(&mesg, buf, mlen);
+ if (len < 0)
+ goto out;
+ if (rawobj_alloc(&rsii->out_handle, buf, len)) {
status = -ENOMEM;
status = -ENOMEM;
- if (rawobj_alloc(&rsii->out_handle, buf, len))
- goto out;
+ goto out;
+ }
-
/* out_token */
-
len = qword_get(&mesg, buf, mlen);
- status = -EINVAL;
- if (len < 0)
- goto out;
+ /* out_token */
+ len = qword_get(&mesg, buf, mlen);
+ if (len < 0)
+ goto out;
+ if (rawobj_alloc(&rsii->out_token, buf, len)) {
status = -ENOMEM;
status = -ENOMEM;
- if (rawobj_alloc(&rsii->out_token, buf, len))
- goto out;
+ goto out;
}
}
+
rsii->h.expiry_time = expiry;
status = gssd_reply(rsii);
out:
rsii->h.expiry_time = expiry;
status = gssd_reply(rsii);
out:
@@
-414,6
+413,7
@@
static void rsc_put(struct cache_head *item, struct cache_detail *cd)
LASSERT(atomic_read(&item->refcnt) > 0);
if (cache_put(item, cd)) {
LASSERT(atomic_read(&item->refcnt) > 0);
if (cache_put(item, cd)) {
+ LASSERT(item->next == NULL);
rsc_free(rsci);
OBD_FREE(rsci, sizeof(*rsci));
}
rsc_free(rsci);
OBD_FREE(rsci, sizeof(*rsci));
}
@@
-448,9
+448,8
@@
static struct rsc *rsc_lookup(struct rsc *item, int set)
if (!rsc_match(tmp, item))
continue;
cache_get(&tmp->h);
if (!rsc_match(tmp, item))
continue;
cache_get(&tmp->h);
- if (!set)
{
+ if (!set)
goto out_noset;
goto out_noset;
- }
*hp = tmp->h.next;
tmp->h.next = NULL;
clear_bit(CACHE_HASHED, &tmp->h.flags);
*hp = tmp->h.next;
tmp->h.next = NULL;
clear_bit(CACHE_HASHED, &tmp->h.flags);