|
@@ -120,11 +120,11 @@ void unix_inflight(struct file *fp)
|
|
{
|
|
{
|
|
struct sock *s = unix_get_socket(fp);
|
|
struct sock *s = unix_get_socket(fp);
|
|
|
|
|
|
|
|
+ spin_lock(&unix_gc_lock);
|
|
|
|
+
|
|
if (s) {
|
|
if (s) {
|
|
struct unix_sock *u = unix_sk(s);
|
|
struct unix_sock *u = unix_sk(s);
|
|
|
|
|
|
- spin_lock(&unix_gc_lock);
|
|
|
|
-
|
|
|
|
if (atomic_long_inc_return(&u->inflight) == 1) {
|
|
if (atomic_long_inc_return(&u->inflight) == 1) {
|
|
BUG_ON(!list_empty(&u->link));
|
|
BUG_ON(!list_empty(&u->link));
|
|
list_add_tail(&u->link, &gc_inflight_list);
|
|
list_add_tail(&u->link, &gc_inflight_list);
|
|
@@ -132,25 +132,28 @@ void unix_inflight(struct file *fp)
|
|
BUG_ON(list_empty(&u->link));
|
|
BUG_ON(list_empty(&u->link));
|
|
}
|
|
}
|
|
unix_tot_inflight++;
|
|
unix_tot_inflight++;
|
|
- spin_unlock(&unix_gc_lock);
|
|
|
|
}
|
|
}
|
|
|
|
+ fp->f_cred->user->unix_inflight++;
|
|
|
|
+ spin_unlock(&unix_gc_lock);
|
|
}
|
|
}
|
|
|
|
|
|
void unix_notinflight(struct file *fp)
|
|
void unix_notinflight(struct file *fp)
|
|
{
|
|
{
|
|
struct sock *s = unix_get_socket(fp);
|
|
struct sock *s = unix_get_socket(fp);
|
|
|
|
|
|
|
|
+ spin_lock(&unix_gc_lock);
|
|
|
|
+
|
|
if (s) {
|
|
if (s) {
|
|
struct unix_sock *u = unix_sk(s);
|
|
struct unix_sock *u = unix_sk(s);
|
|
|
|
|
|
- spin_lock(&unix_gc_lock);
|
|
|
|
BUG_ON(list_empty(&u->link));
|
|
BUG_ON(list_empty(&u->link));
|
|
|
|
|
|
if (atomic_long_dec_and_test(&u->inflight))
|
|
if (atomic_long_dec_and_test(&u->inflight))
|
|
list_del_init(&u->link);
|
|
list_del_init(&u->link);
|
|
unix_tot_inflight--;
|
|
unix_tot_inflight--;
|
|
- spin_unlock(&unix_gc_lock);
|
|
|
|
}
|
|
}
|
|
|
|
+ fp->f_cred->user->unix_inflight--;
|
|
|
|
+ spin_unlock(&unix_gc_lock);
|
|
}
|
|
}
|
|
|
|
|
|
static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
|
|
static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
|