projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tools headers UAPI: Sync linux/kvm.h with the kernel sources
[linux-2.6-microblaze.git]
/
kernel
/
signal.c
diff --git
a/kernel/signal.c
b/kernel/signal.c
index
20d1d89
..
de09203
100644
(file)
--- a/
kernel/signal.c
+++ b/
kernel/signal.c
@@
-412,8
+412,8
@@
__sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags,
int override_rlimit, const unsigned int sigqueue_flags)
{
struct sigqueue *q = NULL;
int override_rlimit, const unsigned int sigqueue_flags)
{
struct sigqueue *q = NULL;
- struct u
ser_struct *user
;
-
int
sigpending;
+ struct u
counts *ucounts = NULL
;
+
long
sigpending;
/*
* Protect access to @t credentials. This can go away when all
/*
* Protect access to @t credentials. This can go away when all
@@
-424,27
+424,26
@@
__sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags,
* changes from/to zero.
*/
rcu_read_lock();
* changes from/to zero.
*/
rcu_read_lock();
- u
ser = __task_cred(t)->user
;
- sigpending =
atomic_inc_return(&user->sigpending
);
+ u
counts = task_ucounts(t)
;
+ sigpending =
inc_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_SIGPENDING, 1
);
if (sigpending == 1)
if (sigpending == 1)
-
get_uid(user
);
+
ucounts = get_ucounts(ucounts
);
rcu_read_unlock();
rcu_read_unlock();
- if (override_rlimit ||
likely(
sigpending <= task_rlimit(t, RLIMIT_SIGPENDING))) {
+ if (override_rlimit ||
(sigpending < LONG_MAX &&
sigpending <= task_rlimit(t, RLIMIT_SIGPENDING))) {
q = kmem_cache_alloc(sigqueue_cachep, gfp_flags);
} else {
print_dropped_signal(sig);
}
if (unlikely(q == NULL)) {
q = kmem_cache_alloc(sigqueue_cachep, gfp_flags);
} else {
print_dropped_signal(sig);
}
if (unlikely(q == NULL)) {
- if (
atomic_dec_and_test(&user->sigpending
))
-
free_uid(user
);
+ if (
ucounts && dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_SIGPENDING, 1
))
+
put_ucounts(ucounts
);
} else {
INIT_LIST_HEAD(&q->list);
q->flags = sigqueue_flags;
} else {
INIT_LIST_HEAD(&q->list);
q->flags = sigqueue_flags;
- q->u
ser = user
;
+ q->u
counts = ucounts
;
}
}
-
return q;
}
return q;
}
@@
-452,8
+451,10
@@
static void __sigqueue_free(struct sigqueue *q)
{
if (q->flags & SIGQUEUE_PREALLOC)
return;
{
if (q->flags & SIGQUEUE_PREALLOC)
return;
- if (atomic_dec_and_test(&q->user->sigpending))
- free_uid(q->user);
+ if (q->ucounts && dec_rlimit_ucounts(q->ucounts, UCOUNT_RLIMIT_SIGPENDING, 1)) {
+ put_ucounts(q->ucounts);
+ q->ucounts = NULL;
+ }
kmem_cache_free(sigqueue_cachep, q);
}
kmem_cache_free(sigqueue_cachep, q);
}