hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/sunrpc/svcauth_unix.c
....@@ -424,14 +424,23 @@
424424 return hash_long(from_kuid(&init_user_ns, uid), GID_HASHBITS);
425425 }
426426
427
+static void unix_gid_free(struct rcu_head *rcu)
428
+{
429
+ struct unix_gid *ug = container_of(rcu, struct unix_gid, rcu);
430
+ struct cache_head *item = &ug->h;
431
+
432
+ if (test_bit(CACHE_VALID, &item->flags) &&
433
+ !test_bit(CACHE_NEGATIVE, &item->flags))
434
+ put_group_info(ug->gi);
435
+ kfree(ug);
436
+}
437
+
427438 static void unix_gid_put(struct kref *kref)
428439 {
429440 struct cache_head *item = container_of(kref, struct cache_head, ref);
430441 struct unix_gid *ug = container_of(item, struct unix_gid, h);
431
- if (test_bit(CACHE_VALID, &item->flags) &&
432
- !test_bit(CACHE_NEGATIVE, &item->flags))
433
- put_group_info(ug->gi);
434
- kfree_rcu(ug, rcu);
442
+
443
+ call_rcu(&ug->rcu, unix_gid_free);
435444 }
436445
437446 static int unix_gid_match(struct cache_head *corig, struct cache_head *cnew)