diff options
-rw-r--r-- | include/linux/cgroup.h | 1 | ||||
-rw-r--r-- | include/linux/cred.h | 1 | ||||
-rw-r--r-- | include/linux/fdtable.h | 1 | ||||
-rw-r--r-- | include/linux/rtnetlink.h | 3 | ||||
-rw-r--r-- | include/net/sock.h | 3 | ||||
-rw-r--r-- | kernel/cgroup.c | 8 | ||||
-rw-r--r-- | kernel/exit.c | 1 | ||||
-rw-r--r-- | kernel/pid.c | 1 | ||||
-rw-r--r-- | kernel/rcutorture.c | 2 | ||||
-rw-r--r-- | kernel/sched.c | 1 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 4 | ||||
-rw-r--r-- | net/netlabel/netlabel_domainhash.c | 3 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 3 | ||||
-rw-r--r-- | security/keys/keyring.c | 1 |
14 files changed, 6 insertions, 27 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ab4ac0ccb857..da7e4bc34e8c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -539,7 +539,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
539 | */ | 539 | */ |
540 | #define task_subsys_state_check(task, subsys_id, __c) \ | 540 | #define task_subsys_state_check(task, subsys_id, __c) \ |
541 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ | 541 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ |
542 | rcu_read_lock_held() || \ | ||
543 | lockdep_is_held(&task->alloc_lock) || \ | 542 | lockdep_is_held(&task->alloc_lock) || \ |
544 | cgroup_lock_is_held() || (__c)) | 543 | cgroup_lock_is_held() || (__c)) |
545 | 544 | ||
diff --git a/include/linux/cred.h b/include/linux/cred.h index 82607992f308..f240f2fa0197 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -284,7 +284,6 @@ static inline void put_cred(const struct cred *_cred) | |||
284 | ({ \ | 284 | ({ \ |
285 | const struct task_struct *__t = (task); \ | 285 | const struct task_struct *__t = (task); \ |
286 | rcu_dereference_check(__t->real_cred, \ | 286 | rcu_dereference_check(__t->real_cred, \ |
287 | rcu_read_lock_held() || \ | ||
288 | task_is_dead(__t)); \ | 287 | task_is_dead(__t)); \ |
289 | }) | 288 | }) |
290 | 289 | ||
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 133c0ba25e30..df7e3cf82e97 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -60,7 +60,6 @@ struct files_struct { | |||
60 | 60 | ||
61 | #define rcu_dereference_check_fdtable(files, fdtfd) \ | 61 | #define rcu_dereference_check_fdtable(files, fdtfd) \ |
62 | (rcu_dereference_check((fdtfd), \ | 62 | (rcu_dereference_check((fdtfd), \ |
63 | rcu_read_lock_held() || \ | ||
64 | lockdep_is_held(&(files)->file_lock) || \ | 63 | lockdep_is_held(&(files)->file_lock) || \ |
65 | atomic_read(&(files)->count) == 1 || \ | 64 | atomic_read(&(files)->count) == 1 || \ |
66 | rcu_my_thread_group_empty())) | 65 | rcu_my_thread_group_empty())) |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index bbad657a3725..27576aa05e8c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -758,8 +758,7 @@ extern int lockdep_rtnl_is_held(void); | |||
758 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() | 758 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() |
759 | */ | 759 | */ |
760 | #define rcu_dereference_rtnl(p) \ | 760 | #define rcu_dereference_rtnl(p) \ |
761 | rcu_dereference_check(p, rcu_read_lock_held() || \ | 761 | rcu_dereference_check(p, lockdep_rtnl_is_held()) |
762 | lockdep_rtnl_is_held()) | ||
763 | 762 | ||
764 | /** | 763 | /** |
765 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL | 764 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL |
diff --git a/include/net/sock.h b/include/net/sock.h index c0b938cb4b1a..d5b65c19a8e3 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1301,8 +1301,7 @@ extern unsigned long sock_i_ino(struct sock *sk); | |||
1301 | static inline struct dst_entry * | 1301 | static inline struct dst_entry * |
1302 | __sk_dst_get(struct sock *sk) | 1302 | __sk_dst_get(struct sock *sk) |
1303 | { | 1303 | { |
1304 | return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || | 1304 | return rcu_dereference_check(sk->sk_dst_cache, sock_owned_by_user(sk) || |
1305 | sock_owned_by_user(sk) || | ||
1306 | lockdep_is_held(&sk->sk_lock.slock)); | 1305 | lockdep_is_held(&sk->sk_lock.slock)); |
1307 | } | 1306 | } |
1308 | 1307 | ||
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 2731d115d725..5ae71d6e274b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1697,7 +1697,6 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) | |||
1697 | { | 1697 | { |
1698 | char *start; | 1698 | char *start; |
1699 | struct dentry *dentry = rcu_dereference_check(cgrp->dentry, | 1699 | struct dentry *dentry = rcu_dereference_check(cgrp->dentry, |
1700 | rcu_read_lock_held() || | ||
1701 | cgroup_lock_is_held()); | 1700 | cgroup_lock_is_held()); |
1702 | 1701 | ||
1703 | if (!dentry || cgrp == dummytop) { | 1702 | if (!dentry || cgrp == dummytop) { |
@@ -1723,7 +1722,6 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) | |||
1723 | break; | 1722 | break; |
1724 | 1723 | ||
1725 | dentry = rcu_dereference_check(cgrp->dentry, | 1724 | dentry = rcu_dereference_check(cgrp->dentry, |
1726 | rcu_read_lock_held() || | ||
1727 | cgroup_lock_is_held()); | 1725 | cgroup_lock_is_held()); |
1728 | if (!cgrp->parent) | 1726 | if (!cgrp->parent) |
1729 | continue; | 1727 | continue; |
@@ -4813,8 +4811,7 @@ unsigned short css_id(struct cgroup_subsys_state *css) | |||
4813 | * on this or this is under rcu_read_lock(). Once css->id is allocated, | 4811 | * on this or this is under rcu_read_lock(). Once css->id is allocated, |
4814 | * it's unchanged until freed. | 4812 | * it's unchanged until freed. |
4815 | */ | 4813 | */ |
4816 | cssid = rcu_dereference_check(css->id, | 4814 | cssid = rcu_dereference_check(css->id, atomic_read(&css->refcnt)); |
4817 | rcu_read_lock_held() || atomic_read(&css->refcnt)); | ||
4818 | 4815 | ||
4819 | if (cssid) | 4816 | if (cssid) |
4820 | return cssid->id; | 4817 | return cssid->id; |
@@ -4826,8 +4823,7 @@ unsigned short css_depth(struct cgroup_subsys_state *css) | |||
4826 | { | 4823 | { |
4827 | struct css_id *cssid; | 4824 | struct css_id *cssid; |
4828 | 4825 | ||
4829 | cssid = rcu_dereference_check(css->id, | 4826 | cssid = rcu_dereference_check(css->id, atomic_read(&css->refcnt)); |
4830 | rcu_read_lock_held() || atomic_read(&css->refcnt)); | ||
4831 | 4827 | ||
4832 | if (cssid) | 4828 | if (cssid) |
4833 | return cssid->depth; | 4829 | return cssid->depth; |
diff --git a/kernel/exit.c b/kernel/exit.c index 20a406471525..07dc154fc799 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -85,7 +85,6 @@ static void __exit_signal(struct task_struct *tsk) | |||
85 | struct tty_struct *uninitialized_var(tty); | 85 | struct tty_struct *uninitialized_var(tty); |
86 | 86 | ||
87 | sighand = rcu_dereference_check(tsk->sighand, | 87 | sighand = rcu_dereference_check(tsk->sighand, |
88 | rcu_read_lock_held() || | ||
89 | lockdep_tasklist_lock_is_held()); | 88 | lockdep_tasklist_lock_is_held()); |
90 | spin_lock(&sighand->siglock); | 89 | spin_lock(&sighand->siglock); |
91 | 90 | ||
diff --git a/kernel/pid.c b/kernel/pid.c index 57a8346a270e..e432057f3b21 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -405,7 +405,6 @@ struct task_struct *pid_task(struct pid *pid, enum pid_type type) | |||
405 | if (pid) { | 405 | if (pid) { |
406 | struct hlist_node *first; | 406 | struct hlist_node *first; |
407 | first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]), | 407 | first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]), |
408 | rcu_read_lock_held() || | ||
409 | lockdep_tasklist_lock_is_held()); | 408 | lockdep_tasklist_lock_is_held()); |
410 | if (first) | 409 | if (first) |
411 | result = hlist_entry(first, struct task_struct, pids[(type)].node); | 410 | result = hlist_entry(first, struct task_struct, pids[(type)].node); |
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 2e138db03382..ced72102adc2 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -941,7 +941,6 @@ static void rcu_torture_timer(unsigned long unused) | |||
941 | idx = cur_ops->readlock(); | 941 | idx = cur_ops->readlock(); |
942 | completed = cur_ops->completed(); | 942 | completed = cur_ops->completed(); |
943 | p = rcu_dereference_check(rcu_torture_current, | 943 | p = rcu_dereference_check(rcu_torture_current, |
944 | rcu_read_lock_held() || | ||
945 | rcu_read_lock_bh_held() || | 944 | rcu_read_lock_bh_held() || |
946 | rcu_read_lock_sched_held() || | 945 | rcu_read_lock_sched_held() || |
947 | srcu_read_lock_held(&srcu_ctl)); | 946 | srcu_read_lock_held(&srcu_ctl)); |
@@ -1002,7 +1001,6 @@ rcu_torture_reader(void *arg) | |||
1002 | idx = cur_ops->readlock(); | 1001 | idx = cur_ops->readlock(); |
1003 | completed = cur_ops->completed(); | 1002 | completed = cur_ops->completed(); |
1004 | p = rcu_dereference_check(rcu_torture_current, | 1003 | p = rcu_dereference_check(rcu_torture_current, |
1005 | rcu_read_lock_held() || | ||
1006 | rcu_read_lock_bh_held() || | 1004 | rcu_read_lock_bh_held() || |
1007 | rcu_read_lock_sched_held() || | 1005 | rcu_read_lock_sched_held() || |
1008 | srcu_read_lock_held(&srcu_ctl)); | 1006 | srcu_read_lock_held(&srcu_ctl)); |
diff --git a/kernel/sched.c b/kernel/sched.c index 3f2e502d609b..71e5a25a8a58 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -581,7 +581,6 @@ static inline int cpu_of(struct rq *rq) | |||
581 | 581 | ||
582 | #define rcu_dereference_check_sched_domain(p) \ | 582 | #define rcu_dereference_check_sched_domain(p) \ |
583 | rcu_dereference_check((p), \ | 583 | rcu_dereference_check((p), \ |
584 | rcu_read_lock_held() || \ | ||
585 | lockdep_is_held(&sched_domains_mutex)) | 584 | lockdep_is_held(&sched_domains_mutex)) |
586 | 585 | ||
587 | /* | 586 | /* |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index b83870bf60fa..3db78b696c5c 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -97,7 +97,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, | |||
97 | struct sta_info *sta; | 97 | struct sta_info *sta; |
98 | 98 | ||
99 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], | 99 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], |
100 | rcu_read_lock_held() || | ||
101 | lockdep_is_held(&local->sta_lock) || | 100 | lockdep_is_held(&local->sta_lock) || |
102 | lockdep_is_held(&local->sta_mtx)); | 101 | lockdep_is_held(&local->sta_mtx)); |
103 | while (sta) { | 102 | while (sta) { |
@@ -105,7 +104,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, | |||
105 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) | 104 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) |
106 | break; | 105 | break; |
107 | sta = rcu_dereference_check(sta->hnext, | 106 | sta = rcu_dereference_check(sta->hnext, |
108 | rcu_read_lock_held() || | ||
109 | lockdep_is_held(&local->sta_lock) || | 107 | lockdep_is_held(&local->sta_lock) || |
110 | lockdep_is_held(&local->sta_mtx)); | 108 | lockdep_is_held(&local->sta_mtx)); |
111 | } | 109 | } |
@@ -123,7 +121,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, | |||
123 | struct sta_info *sta; | 121 | struct sta_info *sta; |
124 | 122 | ||
125 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], | 123 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], |
126 | rcu_read_lock_held() || | ||
127 | lockdep_is_held(&local->sta_lock) || | 124 | lockdep_is_held(&local->sta_lock) || |
128 | lockdep_is_held(&local->sta_mtx)); | 125 | lockdep_is_held(&local->sta_mtx)); |
129 | while (sta) { | 126 | while (sta) { |
@@ -132,7 +129,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, | |||
132 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) | 129 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) |
133 | break; | 130 | break; |
134 | sta = rcu_dereference_check(sta->hnext, | 131 | sta = rcu_dereference_check(sta->hnext, |
135 | rcu_read_lock_held() || | ||
136 | lockdep_is_held(&local->sta_lock) || | 132 | lockdep_is_held(&local->sta_lock) || |
137 | lockdep_is_held(&local->sta_mtx)); | 133 | lockdep_is_held(&local->sta_mtx)); |
138 | } | 134 | } |
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index de0d8e4cbfb6..2aa975e5452d 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
@@ -55,8 +55,7 @@ struct netlbl_domhsh_tbl { | |||
55 | * should be okay */ | 55 | * should be okay */ |
56 | static DEFINE_SPINLOCK(netlbl_domhsh_lock); | 56 | static DEFINE_SPINLOCK(netlbl_domhsh_lock); |
57 | #define netlbl_domhsh_rcu_deref(p) \ | 57 | #define netlbl_domhsh_rcu_deref(p) \ |
58 | rcu_dereference_check(p, rcu_read_lock_held() || \ | 58 | rcu_dereference_check(p, lockdep_is_held(&netlbl_domhsh_lock)) |
59 | lockdep_is_held(&netlbl_domhsh_lock)) | ||
60 | static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; | 59 | static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; |
61 | static struct netlbl_dom_map *netlbl_domhsh_def = NULL; | 60 | static struct netlbl_dom_map *netlbl_domhsh_def = NULL; |
62 | 61 | ||
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 9c38658fba8b..3de3768360fd 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -116,8 +116,7 @@ struct netlbl_unlhsh_walk_arg { | |||
116 | * hash table should be okay */ | 116 | * hash table should be okay */ |
117 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); | 117 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); |
118 | #define netlbl_unlhsh_rcu_deref(p) \ | 118 | #define netlbl_unlhsh_rcu_deref(p) \ |
119 | rcu_dereference_check(p, rcu_read_lock_held() || \ | 119 | rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock)) |
120 | lockdep_is_held(&netlbl_unlhsh_lock)) | ||
121 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; | 120 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; |
122 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; | 121 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; |
123 | 122 | ||
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index a06ffab38568..30e242f7bd0e 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -155,7 +155,6 @@ static void keyring_destroy(struct key *keyring) | |||
155 | } | 155 | } |
156 | 156 | ||
157 | klist = rcu_dereference_check(keyring->payload.subscriptions, | 157 | klist = rcu_dereference_check(keyring->payload.subscriptions, |
158 | rcu_read_lock_held() || | ||
159 | atomic_read(&keyring->usage) == 0); | 158 | atomic_read(&keyring->usage) == 0); |
160 | if (klist) { | 159 | if (klist) { |
161 | for (loop = klist->nkeys - 1; loop >= 0; loop--) | 160 | for (loop = klist->nkeys - 1; loop >= 0; loop--) |