Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357810
b: refs/heads/master
c: 9e469e3
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent cb1ea57 commit dc072b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 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: 683428fae8c73d7d7da0fa2e0b6beb4d8df4e808
refs/heads/master: 9e469e30d712b54cd3ff4a82d4dd5510522b8f16
2 changes: 1 addition & 1 deletion trunk/net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ rpcauth_lookup_credcache(struct rpc_auth *auth, struct auth_cred * acred,
*entry, *new;
unsigned int nr;

nr = hash_long(acred->uid, cache->hashbits);
nr = hash_long(from_kuid(&init_user_ns, acred->uid), cache->hashbits);

rcu_read_lock();
hlist_for_each_entry_rcu(entry, pos, &cache->hashtable[nr], cr_hash) {
Expand Down
9 changes: 7 additions & 2 deletions trunk/net/sunrpc/svcauth_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ struct unix_gid {
struct group_info *gi;
};

static int unix_gid_hash(kuid_t uid)
{
return hash_long(from_kuid(&init_user_ns, uid), GID_HASHBITS);
}

static void unix_gid_put(struct kref *kref)
{
struct cache_head *item = container_of(kref, struct cache_head, ref);
Expand Down Expand Up @@ -530,7 +535,7 @@ static int unix_gid_parse(struct cache_detail *cd,
ug.h.expiry_time = expiry;
ch = sunrpc_cache_update(cd,
&ug.h, &ugp->h,
hash_long(uid, GID_HASHBITS));
unix_gid_hash(uid));
if (!ch)
err = -ENOMEM;
else {
Expand Down Expand Up @@ -621,7 +626,7 @@ static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, kuid_t uid)
struct cache_head *ch;

ug.uid = uid;
ch = sunrpc_cache_lookup(cd, &ug.h, hash_long(uid, GID_HASHBITS));
ch = sunrpc_cache_lookup(cd, &ug.h, unix_gid_hash(uid));
if (ch)
return container_of(ch, struct unix_gid, h);
else
Expand Down

0 comments on commit dc072b1

Please sign in to comment.