Magellan Linux

Annotation of /trunk/kernel-magellan/patches-3.18/0100-3.18.1-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2528 - (hide annotations) (download)
Tue Jan 13 09:11:52 2015 UTC (9 years, 3 months ago) by niro
File size: 44662 byte(s)
-patches for linux-3.18.2
1 niro 2528 diff --git a/Makefile b/Makefile
2     index fd80c6e9bc23..3f84029f2b31 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 3
7     PATCHLEVEL = 18
8     -SUBLEVEL = 0
9     +SUBLEVEL = 1
10     EXTRAVERSION =
11     NAME = Diseased Newt
12    
13     diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
14     index 9b55143d19db..9fd6834a2172 100644
15     --- a/arch/mips/net/bpf_jit.c
16     +++ b/arch/mips/net/bpf_jit.c
17     @@ -426,7 +426,7 @@ static inline void emit_mod(unsigned int dst, unsigned int src,
18     u32 *p = &ctx->target[ctx->idx];
19     uasm_i_divu(&p, dst, src);
20     p = &ctx->target[ctx->idx + 1];
21     - uasm_i_mflo(&p, dst);
22     + uasm_i_mfhi(&p, dst);
23     }
24     ctx->idx += 2; /* 2 insts */
25     }
26     @@ -971,7 +971,7 @@ load_ind:
27     break;
28     case BPF_ALU | BPF_MOD | BPF_K:
29     /* A %= k */
30     - if (k == 1 || optimize_div(&k)) {
31     + if (k == 1) {
32     ctx->flags |= SEEN_A;
33     emit_jit_reg_move(r_A, r_zero, ctx);
34     } else {
35     diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
36     index 87ba7cf99cd7..65d633f20d37 100644
37     --- a/arch/powerpc/platforms/cell/spufs/inode.c
38     +++ b/arch/powerpc/platforms/cell/spufs/inode.c
39     @@ -164,7 +164,7 @@ static void spufs_prune_dir(struct dentry *dir)
40     struct dentry *dentry, *tmp;
41    
42     mutex_lock(&dir->d_inode->i_mutex);
43     - list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) {
44     + list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
45     spin_lock(&dentry->d_lock);
46     if (!(d_unhashed(dentry)) && dentry->d_inode) {
47     dget_dlock(dentry);
48     diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
49     index ade067de1689..67a84cfaefa1 100644
50     --- a/drivers/net/ethernet/marvell/mvneta.c
51     +++ b/drivers/net/ethernet/marvell/mvneta.c
52     @@ -216,7 +216,7 @@
53     /* Various constants */
54    
55     /* Coalescing */
56     -#define MVNETA_TXDONE_COAL_PKTS 16
57     +#define MVNETA_TXDONE_COAL_PKTS 1
58     #define MVNETA_RX_COAL_PKTS 32
59     #define MVNETA_RX_COAL_USEC 100
60    
61     @@ -1721,6 +1721,7 @@ static int mvneta_tx(struct sk_buff *skb, struct net_device *dev)
62     u16 txq_id = skb_get_queue_mapping(skb);
63     struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
64     struct mvneta_tx_desc *tx_desc;
65     + int len = skb->len;
66     int frags = 0;
67     u32 tx_cmd;
68    
69     @@ -1788,7 +1789,7 @@ out:
70    
71     u64_stats_update_begin(&stats->syncp);
72     stats->tx_packets++;
73     - stats->tx_bytes += skb->len;
74     + stats->tx_bytes += len;
75     u64_stats_update_end(&stats->syncp);
76     } else {
77     dev->stats.tx_dropped++;
78     diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
79     index be4649a49c5e..42b2d6a56d05 100644
80     --- a/drivers/net/vxlan.c
81     +++ b/drivers/net/vxlan.c
82     @@ -1995,9 +1995,8 @@ static int vxlan_init(struct net_device *dev)
83     spin_lock(&vn->sock_lock);
84     vs = vxlan_find_sock(vxlan->net, ipv6 ? AF_INET6 : AF_INET,
85     vxlan->dst_port);
86     - if (vs) {
87     + if (vs && atomic_add_unless(&vs->refcnt, 1, 0)) {
88     /* If we have a socket with same port already, reuse it */
89     - atomic_inc(&vs->refcnt);
90     vxlan_vs_add_dev(vs, vxlan);
91     } else {
92     /* otherwise make new socket outside of RTNL */
93     @@ -2396,12 +2395,9 @@ struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
94    
95     spin_lock(&vn->sock_lock);
96     vs = vxlan_find_sock(net, ipv6 ? AF_INET6 : AF_INET, port);
97     - if (vs) {
98     - if (vs->rcv == rcv)
99     - atomic_inc(&vs->refcnt);
100     - else
101     + if (vs && ((vs->rcv != rcv) ||
102     + !atomic_add_unless(&vs->refcnt, 1, 0)))
103     vs = ERR_PTR(-EBUSY);
104     - }
105     spin_unlock(&vn->sock_lock);
106    
107     if (!vs)
108     diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
109     index 55357d69397a..d2ec5160bbf0 100644
110     --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
111     +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
112     @@ -1287,6 +1287,7 @@ void rtl92ce_enable_interrupt(struct ieee80211_hw *hw)
113    
114     rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF);
115     rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
116     + rtlpci->irq_enabled = true;
117     }
118    
119     void rtl92ce_disable_interrupt(struct ieee80211_hw *hw)
120     @@ -1296,7 +1297,7 @@ void rtl92ce_disable_interrupt(struct ieee80211_hw *hw)
121    
122     rtl_write_dword(rtlpriv, REG_HIMR, IMR8190_DISABLED);
123     rtl_write_dword(rtlpriv, REG_HIMRE, IMR8190_DISABLED);
124     - synchronize_irq(rtlpci->pdev->irq);
125     + rtlpci->irq_enabled = false;
126     }
127    
128     static void _rtl92ce_poweroff_adapter(struct ieee80211_hw *hw)
129     diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
130     index 46ea07605eb4..dd5aa089126a 100644
131     --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
132     +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
133     @@ -228,6 +228,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
134     .led_control = rtl92ce_led_control,
135     .set_desc = rtl92ce_set_desc,
136     .get_desc = rtl92ce_get_desc,
137     + .is_tx_desc_closed = rtl92ce_is_tx_desc_closed,
138     .tx_polling = rtl92ce_tx_polling,
139     .enable_hw_sec = rtl92ce_enable_hw_security_config,
140     .set_key = rtl92ce_set_key,
141     @@ -271,6 +272,8 @@ static struct rtl_hal_cfg rtl92ce_hal_cfg = {
142     .maps[MAC_RCR_ACRC32] = ACRC32,
143     .maps[MAC_RCR_ACF] = ACF,
144     .maps[MAC_RCR_AAP] = AAP,
145     + .maps[MAC_HIMR] = REG_HIMR,
146     + .maps[MAC_HIMRE] = REG_HIMRE,
147    
148     .maps[EFUSE_TEST] = REG_EFUSE_TEST,
149     .maps[EFUSE_CTRL] = REG_EFUSE_CTRL,
150     diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
151     index dc3d20b17a26..e88dcd0e0af1 100644
152     --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
153     +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
154     @@ -720,16 +720,15 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
155     break;
156     }
157     } else {
158     - struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc;
159     switch (desc_name) {
160     case HW_DESC_OWN:
161     - ret = GET_RX_DESC_OWN(pdesc);
162     + ret = GET_RX_DESC_OWN(p_desc);
163     break;
164     case HW_DESC_RXPKT_LEN:
165     - ret = GET_RX_DESC_PKT_LEN(pdesc);
166     + ret = GET_RX_DESC_PKT_LEN(p_desc);
167     break;
168     case HW_DESC_RXBUFF_ADDR:
169     - ret = GET_RX_STATUS_DESC_BUFF_ADDR(pdesc);
170     + ret = GET_RX_DESC_BUFF_ADDR(p_desc);
171     break;
172     default:
173     RT_ASSERT(false, "ERR rxdesc :%d not process\n",
174     @@ -740,6 +739,23 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
175     return ret;
176     }
177    
178     +bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw *hw,
179     + u8 hw_queue, u16 index)
180     +{
181     + struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
182     + struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
183     + u8 *entry = (u8 *)(&ring->desc[ring->idx]);
184     + u8 own = (u8)rtl92ce_get_desc(entry, true, HW_DESC_OWN);
185     +
186     + /*beacon packet will only use the first
187     + *descriptor defautly,and the own may not
188     + *be cleared by the hardware
189     + */
190     + if (own)
191     + return false;
192     + return true;
193     +}
194     +
195     void rtl92ce_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
196     {
197     struct rtl_priv *rtlpriv = rtl_priv(hw);
198     diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
199     index 9a39ec4204dd..4bec4b07e3e0 100644
200     --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
201     +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
202     @@ -723,6 +723,8 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
203     void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
204     u8 desc_name, u8 *val);
205     u32 rtl92ce_get_desc(u8 *pdesc, bool istx, u8 desc_name);
206     +bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw *hw,
207     + u8 hw_queue, u16 index);
208     void rtl92ce_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
209     void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
210     bool b_firstseg, bool b_lastseg,
211     diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
212     index ece8d1804d13..eeed0ce620f3 100644
213     --- a/drivers/net/xen-netfront.c
214     +++ b/drivers/net/xen-netfront.c
215     @@ -627,6 +627,9 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
216     slots, skb->len);
217     if (skb_linearize(skb))
218     goto drop;
219     + data = skb->data;
220     + offset = offset_in_page(data);
221     + len = skb_headlen(skb);
222     }
223    
224     spin_lock_irqsave(&queue->tx_lock, flags);
225     diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
226     index 439e4875b05c..311907b762bd 100644
227     --- a/drivers/staging/lustre/lustre/llite/dcache.c
228     +++ b/drivers/staging/lustre/lustre/llite/dcache.c
229     @@ -258,7 +258,7 @@ void ll_invalidate_aliases(struct inode *inode)
230     inode->i_ino, inode->i_generation, inode);
231    
232     ll_lock_dcache(inode);
233     - ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) {
234     + ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) {
235     CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p "
236     "inode %p flags %d\n", dentry->d_name.len,
237     dentry->d_name.name, dentry, dentry->d_parent,
238     diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
239     index a8bcc51057f1..f4ca7b753021 100644
240     --- a/drivers/staging/lustre/lustre/llite/llite_lib.c
241     +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
242     @@ -711,7 +711,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)
243     return;
244    
245     list_for_each(tmp, &dentry->d_subdirs) {
246     - struct dentry *d = list_entry(tmp, struct dentry, d_u.d_child);
247     + struct dentry *d = list_entry(tmp, struct dentry, d_child);
248     lustre_dump_dentry(d, recur - 1);
249     }
250     }
251     diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
252     index 7a68c1e027e0..6dfd98509268 100644
253     --- a/drivers/staging/lustre/lustre/llite/namei.c
254     +++ b/drivers/staging/lustre/lustre/llite/namei.c
255     @@ -167,14 +167,14 @@ static void ll_invalidate_negative_children(struct inode *dir)
256     struct ll_d_hlist_node *p;
257    
258     ll_lock_dcache(dir);
259     - ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_alias) {
260     + ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) {
261     spin_lock(&dentry->d_lock);
262     if (!list_empty(&dentry->d_subdirs)) {
263     struct dentry *child;
264    
265     list_for_each_entry_safe(child, tmp_subdir,
266     &dentry->d_subdirs,
267     - d_u.d_child) {
268     + d_child) {
269     if (child->d_inode == NULL)
270     d_lustre_invalidate(child, 1);
271     }
272     @@ -362,7 +362,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
273     discon_alias = invalid_alias = NULL;
274    
275     ll_lock_dcache(inode);
276     - ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_alias) {
277     + ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_u.d_alias) {
278     LASSERT(alias != dentry);
279    
280     spin_lock(&alias->d_lock);
281     @@ -953,7 +953,7 @@ static void ll_get_child_fid(struct inode * dir, struct qstr *name,
282     {
283     struct dentry *parent, *child;
284    
285     - parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias);
286     + parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_u.d_alias);
287     child = d_lookup(parent, name);
288     if (child) {
289     if (child->d_inode)
290     diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
291     index abc853968fed..937ce8754b24 100644
292     --- a/fs/affs/amigaffs.c
293     +++ b/fs/affs/amigaffs.c
294     @@ -125,7 +125,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino)
295     {
296     struct dentry *dentry;
297     spin_lock(&inode->i_lock);
298     - hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
299     + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
300     if (entry_ino == (u32)(long)dentry->d_fsdata) {
301     dentry->d_fsdata = (void *)inode->i_ino;
302     break;
303     diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
304     index 683a5b9ce22a..dcdec6fd33c6 100644
305     --- a/fs/autofs4/expire.c
306     +++ b/fs/autofs4/expire.c
307     @@ -85,7 +85,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
308     spin_lock(&root->d_lock);
309    
310     if (prev)
311     - next = prev->d_u.d_child.next;
312     + next = prev->d_child.next;
313     else {
314     prev = dget_dlock(root);
315     next = prev->d_subdirs.next;
316     @@ -99,13 +99,13 @@ cont:
317     return NULL;
318     }
319    
320     - q = list_entry(next, struct dentry, d_u.d_child);
321     + q = list_entry(next, struct dentry, d_child);
322    
323     spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
324     /* Already gone or negative dentry (under construction) - try next */
325     if (!d_count(q) || !simple_positive(q)) {
326     spin_unlock(&q->d_lock);
327     - next = q->d_u.d_child.next;
328     + next = q->d_child.next;
329     goto cont;
330     }
331     dget_dlock(q);
332     @@ -155,13 +155,13 @@ again:
333     goto relock;
334     }
335     spin_unlock(&p->d_lock);
336     - next = p->d_u.d_child.next;
337     + next = p->d_child.next;
338     p = parent;
339     if (next != &parent->d_subdirs)
340     break;
341     }
342     }
343     - ret = list_entry(next, struct dentry, d_u.d_child);
344     + ret = list_entry(next, struct dentry, d_child);
345    
346     spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
347     /* Negative dentry - try next */
348     @@ -489,7 +489,7 @@ found:
349     spin_lock(&sbi->lookup_lock);
350     spin_lock(&expired->d_parent->d_lock);
351     spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
352     - list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child);
353     + list_move(&expired->d_parent->d_subdirs, &expired->d_child);
354     spin_unlock(&expired->d_lock);
355     spin_unlock(&expired->d_parent->d_lock);
356     spin_unlock(&sbi->lookup_lock);
357     diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
358     index d76d083f2f06..0822c9eacc56 100644
359     --- a/fs/autofs4/root.c
360     +++ b/fs/autofs4/root.c
361     @@ -687,7 +687,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
362     /* only consider parents below dentrys in the root */
363     if (IS_ROOT(parent->d_parent))
364     return;
365     - d_child = &dentry->d_u.d_child;
366     + d_child = &dentry->d_child;
367     /* Set parent managed if it's becoming empty */
368     if (d_child->next == &parent->d_subdirs &&
369     d_child->prev == &parent->d_subdirs)
370     diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
371     index e6d63f8f98c0..695e7888fef8 100644
372     --- a/fs/ceph/dir.c
373     +++ b/fs/ceph/dir.c
374     @@ -111,7 +111,7 @@ static int fpos_cmp(loff_t l, loff_t r)
375     /*
376     * When possible, we try to satisfy a readdir by peeking at the
377     * dcache. We make this work by carefully ordering dentries on
378     - * d_u.d_child when we initially get results back from the MDS, and
379     + * d_child when we initially get results back from the MDS, and
380     * falling back to a "normal" sync readdir if any dentries in the dir
381     * are dropped.
382     *
383     @@ -147,11 +147,11 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
384     p = parent->d_subdirs.prev;
385     dout(" initial p %p/%p\n", p->prev, p->next);
386     } else {
387     - p = last->d_u.d_child.prev;
388     + p = last->d_child.prev;
389     }
390    
391     more:
392     - dentry = list_entry(p, struct dentry, d_u.d_child);
393     + dentry = list_entry(p, struct dentry, d_child);
394     di = ceph_dentry(dentry);
395     while (1) {
396     dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next,
397     @@ -174,7 +174,7 @@ more:
398     !dentry->d_inode ? " null" : "");
399     spin_unlock(&dentry->d_lock);
400     p = p->prev;
401     - dentry = list_entry(p, struct dentry, d_u.d_child);
402     + dentry = list_entry(p, struct dentry, d_child);
403     di = ceph_dentry(dentry);
404     }
405    
406     diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
407     index 7b6139004401..7a1df90c7771 100644
408     --- a/fs/ceph/inode.c
409     +++ b/fs/ceph/inode.c
410     @@ -1399,7 +1399,7 @@ retry_lookup:
411     /* reorder parent's d_subdirs */
412     spin_lock(&parent->d_lock);
413     spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
414     - list_move(&dn->d_u.d_child, &parent->d_subdirs);
415     + list_move(&dn->d_child, &parent->d_subdirs);
416     spin_unlock(&dn->d_lock);
417     spin_unlock(&parent->d_lock);
418     }
419     diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
420     index 197cb503d528..0c3ce464cae4 100644
421     --- a/fs/cifs/inode.c
422     +++ b/fs/cifs/inode.c
423     @@ -895,7 +895,7 @@ inode_has_hashed_dentries(struct inode *inode)
424     struct dentry *dentry;
425    
426     spin_lock(&inode->i_lock);
427     - hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
428     + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
429     if (!d_unhashed(dentry) || IS_ROOT(dentry)) {
430     spin_unlock(&inode->i_lock);
431     return true;
432     diff --git a/fs/coda/cache.c b/fs/coda/cache.c
433     index 278f8fdeb9ef..46ee6f238985 100644
434     --- a/fs/coda/cache.c
435     +++ b/fs/coda/cache.c
436     @@ -92,7 +92,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
437     struct dentry *de;
438    
439     spin_lock(&parent->d_lock);
440     - list_for_each_entry(de, &parent->d_subdirs, d_u.d_child) {
441     + list_for_each_entry(de, &parent->d_subdirs, d_child) {
442     /* don't know what to do with negative dentries */
443     if (de->d_inode )
444     coda_flag_inode(de->d_inode, flag);
445     diff --git a/fs/dcache.c b/fs/dcache.c
446     index 5bc72b07fde2..71acf8d6f2be 100644
447     --- a/fs/dcache.c
448     +++ b/fs/dcache.c
449     @@ -44,7 +44,7 @@
450     /*
451     * Usage:
452     * dcache->d_inode->i_lock protects:
453     - * - i_dentry, d_alias, d_inode of aliases
454     + * - i_dentry, d_u.d_alias, d_inode of aliases
455     * dcache_hash_bucket lock protects:
456     * - the dcache hash table
457     * s_anon bl list spinlock protects:
458     @@ -59,7 +59,7 @@
459     * - d_unhashed()
460     * - d_parent and d_subdirs
461     * - childrens' d_child and d_parent
462     - * - d_alias, d_inode
463     + * - d_u.d_alias, d_inode
464     *
465     * Ordering:
466     * dentry->d_inode->i_lock
467     @@ -252,14 +252,12 @@ static void __d_free(struct rcu_head *head)
468     {
469     struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
470    
471     - WARN_ON(!hlist_unhashed(&dentry->d_alias));
472     kmem_cache_free(dentry_cache, dentry);
473     }
474    
475     static void __d_free_external(struct rcu_head *head)
476     {
477     struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
478     - WARN_ON(!hlist_unhashed(&dentry->d_alias));
479     kfree(external_name(dentry));
480     kmem_cache_free(dentry_cache, dentry);
481     }
482     @@ -271,6 +269,7 @@ static inline int dname_external(const struct dentry *dentry)
483    
484     static void dentry_free(struct dentry *dentry)
485     {
486     + WARN_ON(!hlist_unhashed(&dentry->d_u.d_alias));
487     if (unlikely(dname_external(dentry))) {
488     struct external_name *p = external_name(dentry);
489     if (likely(atomic_dec_and_test(&p->u.count))) {
490     @@ -311,7 +310,7 @@ static void dentry_iput(struct dentry * dentry)
491     struct inode *inode = dentry->d_inode;
492     if (inode) {
493     dentry->d_inode = NULL;
494     - hlist_del_init(&dentry->d_alias);
495     + hlist_del_init(&dentry->d_u.d_alias);
496     spin_unlock(&dentry->d_lock);
497     spin_unlock(&inode->i_lock);
498     if (!inode->i_nlink)
499     @@ -336,7 +335,7 @@ static void dentry_unlink_inode(struct dentry * dentry)
500     struct inode *inode = dentry->d_inode;
501     __d_clear_type(dentry);
502     dentry->d_inode = NULL;
503     - hlist_del_init(&dentry->d_alias);
504     + hlist_del_init(&dentry->d_u.d_alias);
505     dentry_rcuwalk_barrier(dentry);
506     spin_unlock(&dentry->d_lock);
507     spin_unlock(&inode->i_lock);
508     @@ -496,7 +495,7 @@ static void __dentry_kill(struct dentry *dentry)
509     }
510     /* if it was on the hash then remove it */
511     __d_drop(dentry);
512     - list_del(&dentry->d_u.d_child);
513     + __list_del_entry(&dentry->d_child);
514     /*
515     * Inform d_walk() that we are no longer attached to the
516     * dentry tree
517     @@ -722,7 +721,7 @@ static struct dentry *__d_find_alias(struct inode *inode)
518    
519     again:
520     discon_alias = NULL;
521     - hlist_for_each_entry(alias, &inode->i_dentry, d_alias) {
522     + hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
523     spin_lock(&alias->d_lock);
524     if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
525     if (IS_ROOT(alias) &&
526     @@ -772,7 +771,7 @@ void d_prune_aliases(struct inode *inode)
527     struct dentry *dentry;
528     restart:
529     spin_lock(&inode->i_lock);
530     - hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
531     + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
532     spin_lock(&dentry->d_lock);
533     if (!dentry->d_lockref.count) {
534     struct dentry *parent = lock_parent(dentry);
535     @@ -1051,7 +1050,7 @@ repeat:
536     resume:
537     while (next != &this_parent->d_subdirs) {
538     struct list_head *tmp = next;
539     - struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
540     + struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
541     next = tmp->next;
542    
543     spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
544     @@ -1083,33 +1082,31 @@ resume:
545     /*
546     * All done at this level ... ascend and resume the search.
547     */
548     + rcu_read_lock();
549     +ascend:
550     if (this_parent != parent) {
551     struct dentry *child = this_parent;
552     this_parent = child->d_parent;
553    
554     - rcu_read_lock();
555     spin_unlock(&child->d_lock);
556     spin_lock(&this_parent->d_lock);
557    
558     - /*
559     - * might go back up the wrong parent if we have had a rename
560     - * or deletion
561     - */
562     - if (this_parent != child->d_parent ||
563     - (child->d_flags & DCACHE_DENTRY_KILLED) ||
564     - need_seqretry(&rename_lock, seq)) {
565     - spin_unlock(&this_parent->d_lock);
566     - rcu_read_unlock();
567     + /* might go back up the wrong parent if we have had a rename. */
568     + if (need_seqretry(&rename_lock, seq))
569     goto rename_retry;
570     + next = child->d_child.next;
571     + while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED)) {
572     + if (next == &this_parent->d_subdirs)
573     + goto ascend;
574     + child = list_entry(next, struct dentry, d_child);
575     + next = next->next;
576     }
577     rcu_read_unlock();
578     - next = child->d_u.d_child.next;
579     goto resume;
580     }
581     - if (need_seqretry(&rename_lock, seq)) {
582     - spin_unlock(&this_parent->d_lock);
583     + if (need_seqretry(&rename_lock, seq))
584     goto rename_retry;
585     - }
586     + rcu_read_unlock();
587     if (finish)
588     finish(data);
589    
590     @@ -1119,6 +1116,9 @@ out_unlock:
591     return;
592    
593     rename_retry:
594     + spin_unlock(&this_parent->d_lock);
595     + rcu_read_unlock();
596     + BUG_ON(seq & 1);
597     if (!retry)
598     return;
599     seq = 1;
600     @@ -1455,8 +1455,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
601     INIT_HLIST_BL_NODE(&dentry->d_hash);
602     INIT_LIST_HEAD(&dentry->d_lru);
603     INIT_LIST_HEAD(&dentry->d_subdirs);
604     - INIT_HLIST_NODE(&dentry->d_alias);
605     - INIT_LIST_HEAD(&dentry->d_u.d_child);
606     + INIT_HLIST_NODE(&dentry->d_u.d_alias);
607     + INIT_LIST_HEAD(&dentry->d_child);
608     d_set_d_op(dentry, dentry->d_sb->s_d_op);
609    
610     this_cpu_inc(nr_dentry);
611     @@ -1486,7 +1486,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
612     */
613     __dget_dlock(parent);
614     dentry->d_parent = parent;
615     - list_add(&dentry->d_u.d_child, &parent->d_subdirs);
616     + list_add(&dentry->d_child, &parent->d_subdirs);
617     spin_unlock(&parent->d_lock);
618    
619     return dentry;
620     @@ -1579,7 +1579,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
621     spin_lock(&dentry->d_lock);
622     __d_set_type(dentry, add_flags);
623     if (inode)
624     - hlist_add_head(&dentry->d_alias, &inode->i_dentry);
625     + hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry);
626     dentry->d_inode = inode;
627     dentry_rcuwalk_barrier(dentry);
628     spin_unlock(&dentry->d_lock);
629     @@ -1603,7 +1603,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
630    
631     void d_instantiate(struct dentry *entry, struct inode * inode)
632     {
633     - BUG_ON(!hlist_unhashed(&entry->d_alias));
634     + BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
635     if (inode)
636     spin_lock(&inode->i_lock);
637     __d_instantiate(entry, inode);
638     @@ -1642,7 +1642,7 @@ static struct dentry *__d_instantiate_unique(struct dentry *entry,
639     return NULL;
640     }
641    
642     - hlist_for_each_entry(alias, &inode->i_dentry, d_alias) {
643     + hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
644     /*
645     * Don't need alias->d_lock here, because aliases with
646     * d_parent == entry->d_parent are not subject to name or
647     @@ -1668,7 +1668,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
648     {
649     struct dentry *result;
650    
651     - BUG_ON(!hlist_unhashed(&entry->d_alias));
652     + BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
653    
654     if (inode)
655     spin_lock(&inode->i_lock);
656     @@ -1699,7 +1699,7 @@ EXPORT_SYMBOL(d_instantiate_unique);
657     */
658     int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode)
659     {
660     - BUG_ON(!hlist_unhashed(&entry->d_alias));
661     + BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
662    
663     spin_lock(&inode->i_lock);
664     if (S_ISDIR(inode->i_mode) && !hlist_empty(&inode->i_dentry)) {
665     @@ -1738,7 +1738,7 @@ static struct dentry * __d_find_any_alias(struct inode *inode)
666    
667     if (hlist_empty(&inode->i_dentry))
668     return NULL;
669     - alias = hlist_entry(inode->i_dentry.first, struct dentry, d_alias);
670     + alias = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
671     __dget(alias);
672     return alias;
673     }
674     @@ -1800,7 +1800,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected)
675     spin_lock(&tmp->d_lock);
676     tmp->d_inode = inode;
677     tmp->d_flags |= add_flags;
678     - hlist_add_head(&tmp->d_alias, &inode->i_dentry);
679     + hlist_add_head(&tmp->d_u.d_alias, &inode->i_dentry);
680     hlist_bl_lock(&tmp->d_sb->s_anon);
681     hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon);
682     hlist_bl_unlock(&tmp->d_sb->s_anon);
683     @@ -2235,7 +2235,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
684     struct dentry *child;
685    
686     spin_lock(&dparent->d_lock);
687     - list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) {
688     + list_for_each_entry(child, &dparent->d_subdirs, d_child) {
689     if (dentry == child) {
690     spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
691     __dget_dlock(dentry);
692     @@ -2526,13 +2526,13 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
693     /* splicing a tree */
694     dentry->d_parent = target->d_parent;
695     target->d_parent = target;
696     - list_del_init(&target->d_u.d_child);
697     - list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
698     + list_del_init(&target->d_child);
699     + list_move(&dentry->d_child, &dentry->d_parent->d_subdirs);
700     } else {
701     /* swapping two dentries */
702     swap(dentry->d_parent, target->d_parent);
703     - list_move(&target->d_u.d_child, &target->d_parent->d_subdirs);
704     - list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
705     + list_move(&target->d_child, &target->d_parent->d_subdirs);
706     + list_move(&dentry->d_child, &dentry->d_parent->d_subdirs);
707     if (exchange)
708     fsnotify_d_move(target);
709     fsnotify_d_move(dentry);
710     @@ -3321,7 +3321,7 @@ void d_tmpfile(struct dentry *dentry, struct inode *inode)
711     {
712     inode_dec_link_count(inode);
713     BUG_ON(dentry->d_name.name != dentry->d_iname ||
714     - !hlist_unhashed(&dentry->d_alias) ||
715     + !hlist_unhashed(&dentry->d_u.d_alias) ||
716     !d_unlinked(dentry));
717     spin_lock(&dentry->d_parent->d_lock);
718     spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
719     diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
720     index 1e3b99d3db0d..05f2960ed7c3 100644
721     --- a/fs/debugfs/inode.c
722     +++ b/fs/debugfs/inode.c
723     @@ -553,7 +553,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
724     * use the d_u.d_child as the rcu head and corrupt this list.
725     */
726     spin_lock(&parent->d_lock);
727     - list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) {
728     + list_for_each_entry(child, &parent->d_subdirs, d_child) {
729     if (!debugfs_positive(child))
730     continue;
731    
732     diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
733     index b01fbfb51f43..a3aa6baad1a1 100644
734     --- a/fs/exportfs/expfs.c
735     +++ b/fs/exportfs/expfs.c
736     @@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result,
737    
738     inode = result->d_inode;
739     spin_lock(&inode->i_lock);
740     - hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
741     + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
742     dget(dentry);
743     spin_unlock(&inode->i_lock);
744     if (toput)
745     diff --git a/fs/libfs.c b/fs/libfs.c
746     index 171d2846f2a3..005843ce5dbd 100644
747     --- a/fs/libfs.c
748     +++ b/fs/libfs.c
749     @@ -114,18 +114,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
750    
751     spin_lock(&dentry->d_lock);
752     /* d_lock not required for cursor */
753     - list_del(&cursor->d_u.d_child);
754     + list_del(&cursor->d_child);
755     p = dentry->d_subdirs.next;
756     while (n && p != &dentry->d_subdirs) {
757     struct dentry *next;
758     - next = list_entry(p, struct dentry, d_u.d_child);
759     + next = list_entry(p, struct dentry, d_child);
760     spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
761     if (simple_positive(next))
762     n--;
763     spin_unlock(&next->d_lock);
764     p = p->next;
765     }
766     - list_add_tail(&cursor->d_u.d_child, p);
767     + list_add_tail(&cursor->d_child, p);
768     spin_unlock(&dentry->d_lock);
769     }
770     }
771     @@ -150,7 +150,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx)
772     {
773     struct dentry *dentry = file->f_path.dentry;
774     struct dentry *cursor = file->private_data;
775     - struct list_head *p, *q = &cursor->d_u.d_child;
776     + struct list_head *p, *q = &cursor->d_child;
777    
778     if (!dir_emit_dots(file, ctx))
779     return 0;
780     @@ -159,7 +159,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx)
781     list_move(q, &dentry->d_subdirs);
782    
783     for (p = q->next; p != &dentry->d_subdirs; p = p->next) {
784     - struct dentry *next = list_entry(p, struct dentry, d_u.d_child);
785     + struct dentry *next = list_entry(p, struct dentry, d_child);
786     spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
787     if (!simple_positive(next)) {
788     spin_unlock(&next->d_lock);
789     @@ -287,7 +287,7 @@ int simple_empty(struct dentry *dentry)
790     int ret = 0;
791    
792     spin_lock(&dentry->d_lock);
793     - list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) {
794     + list_for_each_entry(child, &dentry->d_subdirs, d_child) {
795     spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
796     if (simple_positive(child)) {
797     spin_unlock(&child->d_lock);
798     diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
799     index 7cb751dfbeef..75424d692fde 100644
800     --- a/fs/ncpfs/dir.c
801     +++ b/fs/ncpfs/dir.c
802     @@ -403,7 +403,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
803    
804     /* If a pointer is invalid, we search the dentry. */
805     spin_lock(&parent->d_lock);
806     - list_for_each_entry(dent, &parent->d_subdirs, d_u.d_child) {
807     + list_for_each_entry(dent, &parent->d_subdirs, d_child) {
808     if ((unsigned long)dent->d_fsdata == fpos) {
809     if (dent->d_inode)
810     dget(dent);
811     diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h
812     index 52cb19d66ecb..b785f74bfe3c 100644
813     --- a/fs/ncpfs/ncplib_kernel.h
814     +++ b/fs/ncpfs/ncplib_kernel.h
815     @@ -191,7 +191,7 @@ ncp_renew_dentries(struct dentry *parent)
816     struct dentry *dentry;
817    
818     spin_lock(&parent->d_lock);
819     - list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
820     + list_for_each_entry(dentry, &parent->d_subdirs, d_child) {
821     if (dentry->d_fsdata == NULL)
822     ncp_age_dentry(server, dentry);
823     else
824     @@ -207,7 +207,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent)
825     struct dentry *dentry;
826    
827     spin_lock(&parent->d_lock);
828     - list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
829     + list_for_each_entry(dentry, &parent->d_subdirs, d_child) {
830     dentry->d_fsdata = NULL;
831     ncp_age_dentry(server, dentry);
832     }
833     diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
834     index 880618a8b048..ebc6a0add5ae 100644
835     --- a/fs/nfs/getroot.c
836     +++ b/fs/nfs/getroot.c
837     @@ -58,7 +58,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
838     */
839     spin_lock(&sb->s_root->d_inode->i_lock);
840     spin_lock(&sb->s_root->d_lock);
841     - hlist_del_init(&sb->s_root->d_alias);
842     + hlist_del_init(&sb->s_root->d_u.d_alias);
843     spin_unlock(&sb->s_root->d_lock);
844     spin_unlock(&sb->s_root->d_inode->i_lock);
845     }
846     diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
847     index 89326acd4561..41e39102743a 100644
848     --- a/fs/notify/fsnotify.c
849     +++ b/fs/notify/fsnotify.c
850     @@ -63,14 +63,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
851     spin_lock(&inode->i_lock);
852     /* run all of the dentries associated with this inode. Since this is a
853     * directory, there damn well better only be one item on this list */
854     - hlist_for_each_entry(alias, &inode->i_dentry, d_alias) {
855     + hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
856     struct dentry *child;
857    
858     /* run all of the children of the original inode and fix their
859     * d_flags to indicate parental interest (their parent is the
860     * original inode) */
861     spin_lock(&alias->d_lock);
862     - list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
863     + list_for_each_entry(child, &alias->d_subdirs, d_child) {
864     if (!child->d_inode)
865     continue;
866    
867     diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
868     index e2e05a106beb..92edcfc23c1c 100644
869     --- a/fs/ocfs2/dcache.c
870     +++ b/fs/ocfs2/dcache.c
871     @@ -172,7 +172,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
872     struct dentry *dentry;
873    
874     spin_lock(&inode->i_lock);
875     - hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
876     + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
877     spin_lock(&dentry->d_lock);
878     if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
879     trace_ocfs2_find_local_alias(dentry->d_name.len,
880     diff --git a/include/linux/dcache.h b/include/linux/dcache.h
881     index b2a2a08523bf..1c2f1b84468b 100644
882     --- a/include/linux/dcache.h
883     +++ b/include/linux/dcache.h
884     @@ -124,15 +124,15 @@ struct dentry {
885     void *d_fsdata; /* fs-specific data */
886    
887     struct list_head d_lru; /* LRU list */
888     + struct list_head d_child; /* child of parent list */
889     + struct list_head d_subdirs; /* our children */
890     /*
891     - * d_child and d_rcu can share memory
892     + * d_alias and d_rcu can share memory
893     */
894     union {
895     - struct list_head d_child; /* child of parent list */
896     + struct hlist_node d_alias; /* inode alias list */
897     struct rcu_head d_rcu;
898     } d_u;
899     - struct list_head d_subdirs; /* our children */
900     - struct hlist_node d_alias; /* inode alias list */
901     };
902    
903     /*
904     diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
905     index 92f4a6cee172..426962b04183 100644
906     --- a/kernel/trace/trace.c
907     +++ b/kernel/trace/trace.c
908     @@ -6417,7 +6417,7 @@ static int instance_mkdir (struct inode *inode, struct dentry *dentry, umode_t m
909     int ret;
910    
911     /* Paranoid: Make sure the parent is the "instances" directory */
912     - parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias);
913     + parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
914     if (WARN_ON_ONCE(parent != trace_instance_dir))
915     return -ENOENT;
916    
917     @@ -6444,7 +6444,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry)
918     int ret;
919    
920     /* Paranoid: Make sure the parent is the "instances" directory */
921     - parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias);
922     + parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
923     if (WARN_ON_ONCE(parent != trace_instance_dir))
924     return -ENOENT;
925    
926     diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
927     index 0cc51edde3a8..1b0df1e504f0 100644
928     --- a/kernel/trace/trace_events.c
929     +++ b/kernel/trace/trace_events.c
930     @@ -461,7 +461,7 @@ static void remove_event_file_dir(struct ftrace_event_file *file)
931    
932     if (dir) {
933     spin_lock(&dir->d_lock); /* probably unneeded */
934     - list_for_each_entry(child, &dir->d_subdirs, d_u.d_child) {
935     + list_for_each_entry(child, &dir->d_subdirs, d_child) {
936     if (child->d_inode) /* probably unneeded */
937     child->d_inode->i_private = NULL;
938     }
939     diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
940     index bb5947b0ce2d..51973ddc05a6 100644
941     --- a/net/ipv4/gre_offload.c
942     +++ b/net/ipv4/gre_offload.c
943     @@ -247,6 +247,9 @@ static int gre_gro_complete(struct sk_buff *skb, int nhoff)
944     err = ptype->callbacks.gro_complete(skb, nhoff + grehlen);
945    
946     rcu_read_unlock();
947     +
948     + skb_set_inner_mac_header(skb, nhoff + grehlen);
949     +
950     return err;
951     }
952    
953     diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
954     index 147be2024290..ef7089ca86e2 100644
955     --- a/net/ipv4/tcp_ipv4.c
956     +++ b/net/ipv4/tcp_ipv4.c
957     @@ -623,6 +623,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
958     arg.iov[0].iov_base = (unsigned char *)&rep;
959     arg.iov[0].iov_len = sizeof(rep.th);
960    
961     + net = sk ? sock_net(sk) : dev_net(skb_dst(skb)->dev);
962     #ifdef CONFIG_TCP_MD5SIG
963     hash_location = tcp_parse_md5sig_option(th);
964     if (!sk && hash_location) {
965     @@ -633,7 +634,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
966     * Incoming packet is checked with md5 hash with finding key,
967     * no RST generated if md5 hash doesn't match.
968     */
969     - sk1 = __inet_lookup_listener(dev_net(skb_dst(skb)->dev),
970     + sk1 = __inet_lookup_listener(net,
971     &tcp_hashinfo, ip_hdr(skb)->saddr,
972     th->source, ip_hdr(skb)->daddr,
973     ntohs(th->source), inet_iif(skb));
974     @@ -681,7 +682,6 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
975     if (sk)
976     arg.bound_dev_if = sk->sk_bound_dev_if;
977    
978     - net = dev_net(skb_dst(skb)->dev);
979     arg.tos = ip_hdr(skb)->tos;
980     ip_send_unicast_reply(net, skb, &TCP_SKB_CB(skb)->header.h4.opt,
981     ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
982     diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
983     index dc495ae2ead0..c277951d783b 100644
984     --- a/net/ipv6/tcp_ipv6.c
985     +++ b/net/ipv6/tcp_ipv6.c
986     @@ -787,16 +787,16 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
987     .queue_hash_add = inet6_csk_reqsk_queue_hash_add,
988     };
989    
990     -static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
991     - u32 tsval, u32 tsecr, int oif,
992     - struct tcp_md5sig_key *key, int rst, u8 tclass,
993     - u32 label)
994     +static void tcp_v6_send_response(struct sock *sk, struct sk_buff *skb, u32 seq,
995     + u32 ack, u32 win, u32 tsval, u32 tsecr,
996     + int oif, struct tcp_md5sig_key *key, int rst,
997     + u8 tclass, u32 label)
998     {
999     const struct tcphdr *th = tcp_hdr(skb);
1000     struct tcphdr *t1;
1001     struct sk_buff *buff;
1002     struct flowi6 fl6;
1003     - struct net *net = dev_net(skb_dst(skb)->dev);
1004     + struct net *net = sk ? sock_net(sk) : dev_net(skb_dst(skb)->dev);
1005     struct sock *ctl_sk = net->ipv6.tcp_sk;
1006     unsigned int tot_len = sizeof(struct tcphdr);
1007     struct dst_entry *dst;
1008     @@ -946,7 +946,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
1009     (th->doff << 2);
1010    
1011     oif = sk ? sk->sk_bound_dev_if : 0;
1012     - tcp_v6_send_response(skb, seq, ack_seq, 0, 0, 0, oif, key, 1, 0, 0);
1013     + tcp_v6_send_response(sk, skb, seq, ack_seq, 0, 0, 0, oif, key, 1, 0, 0);
1014    
1015     #ifdef CONFIG_TCP_MD5SIG
1016     release_sk1:
1017     @@ -957,13 +957,13 @@ release_sk1:
1018     #endif
1019     }
1020    
1021     -static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
1022     - u32 win, u32 tsval, u32 tsecr, int oif,
1023     +static void tcp_v6_send_ack(struct sock *sk, struct sk_buff *skb, u32 seq,
1024     + u32 ack, u32 win, u32 tsval, u32 tsecr, int oif,
1025     struct tcp_md5sig_key *key, u8 tclass,
1026     u32 label)
1027     {
1028     - tcp_v6_send_response(skb, seq, ack, win, tsval, tsecr, oif, key, 0, tclass,
1029     - label);
1030     + tcp_v6_send_response(sk, skb, seq, ack, win, tsval, tsecr, oif, key, 0,
1031     + tclass, label);
1032     }
1033    
1034     static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb)
1035     @@ -971,7 +971,7 @@ static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb)
1036     struct inet_timewait_sock *tw = inet_twsk(sk);
1037     struct tcp_timewait_sock *tcptw = tcp_twsk(sk);
1038    
1039     - tcp_v6_send_ack(skb, tcptw->tw_snd_nxt, tcptw->tw_rcv_nxt,
1040     + tcp_v6_send_ack(sk, skb, tcptw->tw_snd_nxt, tcptw->tw_rcv_nxt,
1041     tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale,
1042     tcp_time_stamp + tcptw->tw_ts_offset,
1043     tcptw->tw_ts_recent, tw->tw_bound_dev_if, tcp_twsk_md5_key(tcptw),
1044     @@ -986,10 +986,10 @@ static void tcp_v6_reqsk_send_ack(struct sock *sk, struct sk_buff *skb,
1045     /* sk->sk_state == TCP_LISTEN -> for regular TCP_SYN_RECV
1046     * sk->sk_state == TCP_SYN_RECV -> for Fast Open.
1047     */
1048     - tcp_v6_send_ack(skb, (sk->sk_state == TCP_LISTEN) ?
1049     + tcp_v6_send_ack(sk, skb, (sk->sk_state == TCP_LISTEN) ?
1050     tcp_rsk(req)->snt_isn + 1 : tcp_sk(sk)->snd_nxt,
1051     - tcp_rsk(req)->rcv_nxt,
1052     - req->rcv_wnd, tcp_time_stamp, req->ts_recent, sk->sk_bound_dev_if,
1053     + tcp_rsk(req)->rcv_nxt, req->rcv_wnd,
1054     + tcp_time_stamp, req->ts_recent, sk->sk_bound_dev_if,
1055     tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr),
1056     0, 0);
1057     }
1058     diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
1059     index 0007b8180397..b6bf8e8caec7 100644
1060     --- a/net/netlink/af_netlink.c
1061     +++ b/net/netlink/af_netlink.c
1062     @@ -3130,7 +3130,7 @@ static int __init netlink_proto_init(void)
1063     .head_offset = offsetof(struct netlink_sock, node),
1064     .key_offset = offsetof(struct netlink_sock, portid),
1065     .key_len = sizeof(u32), /* portid */
1066     - .hashfn = arch_fast_hash,
1067     + .hashfn = jhash,
1068     .max_shift = 16, /* 64K */
1069     .grow_decision = rht_grow_above_75,
1070     .shrink_decision = rht_shrink_below_30,
1071     diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
1072     index 089b195c064a..918e96645b05 100644
1073     --- a/net/openvswitch/flow_netlink.c
1074     +++ b/net/openvswitch/flow_netlink.c
1075     @@ -145,7 +145,7 @@ static bool match_validate(const struct sw_flow_match *match,
1076     if (match->key->eth.type == htons(ETH_P_ARP)
1077     || match->key->eth.type == htons(ETH_P_RARP)) {
1078     key_expected |= 1 << OVS_KEY_ATTR_ARP;
1079     - if (match->mask && (match->mask->key.tp.src == htons(0xff)))
1080     + if (match->mask && (match->mask->key.eth.type == htons(0xffff)))
1081     mask_allowed |= 1 << OVS_KEY_ATTR_ARP;
1082     }
1083    
1084     @@ -220,7 +220,7 @@ static bool match_validate(const struct sw_flow_match *match,
1085     htons(NDISC_NEIGHBOUR_SOLICITATION) ||
1086     match->key->tp.src == htons(NDISC_NEIGHBOUR_ADVERTISEMENT)) {
1087     key_expected |= 1 << OVS_KEY_ATTR_ND;
1088     - if (match->mask && (match->mask->key.tp.src == htons(0xffff)))
1089     + if (match->mask && (match->mask->key.tp.src == htons(0xff)))
1090     mask_allowed |= 1 << OVS_KEY_ATTR_ND;
1091     }
1092     }
1093     diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
1094     index b9ca32ebc1de..1e52decb7b59 100644
1095     --- a/net/sched/sch_fq_codel.c
1096     +++ b/net/sched/sch_fq_codel.c
1097     @@ -94,7 +94,7 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,
1098     TC_H_MIN(skb->priority) <= q->flows_cnt)
1099     return TC_H_MIN(skb->priority);
1100    
1101     - filter = rcu_dereference(q->filter_list);
1102     + filter = rcu_dereference_bh(q->filter_list);
1103     if (!filter)
1104     return fq_codel_hash(q, skb) + 1;
1105    
1106     diff --git a/net/sctp/output.c b/net/sctp/output.c
1107     index 42dffd428389..fc5e45b8a832 100644
1108     --- a/net/sctp/output.c
1109     +++ b/net/sctp/output.c
1110     @@ -401,12 +401,12 @@ int sctp_packet_transmit(struct sctp_packet *packet)
1111     sk = chunk->skb->sk;
1112    
1113     /* Allocate the new skb. */
1114     - nskb = alloc_skb(packet->size + LL_MAX_HEADER, GFP_ATOMIC);
1115     + nskb = alloc_skb(packet->size + MAX_HEADER, GFP_ATOMIC);
1116     if (!nskb)
1117     goto nomem;
1118    
1119     /* Make sure the outbound skb has enough header room reserved. */
1120     - skb_reserve(nskb, packet->overhead + LL_MAX_HEADER);
1121     + skb_reserve(nskb, packet->overhead + MAX_HEADER);
1122    
1123     /* Set the owning socket so that we know where to get the
1124     * destination IP address.
1125     diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
1126     index c71737f6d1cc..33db1ad4fd10 100644
1127     --- a/security/selinux/selinuxfs.c
1128     +++ b/security/selinux/selinuxfs.c
1129     @@ -1200,7 +1200,7 @@ static void sel_remove_entries(struct dentry *de)
1130     spin_lock(&de->d_lock);
1131     node = de->d_subdirs.next;
1132     while (node != &de->d_subdirs) {
1133     - struct dentry *d = list_entry(node, struct dentry, d_u.d_child);
1134     + struct dentry *d = list_entry(node, struct dentry, d_child);
1135    
1136     spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
1137     list_del_init(node);
1138     @@ -1674,12 +1674,12 @@ static void sel_remove_classes(void)
1139    
1140     list_for_each(class_node, &class_dir->d_subdirs) {
1141     struct dentry *class_subdir = list_entry(class_node,
1142     - struct dentry, d_u.d_child);
1143     + struct dentry, d_child);
1144     struct list_head *class_subdir_node;
1145    
1146     list_for_each(class_subdir_node, &class_subdir->d_subdirs) {
1147     struct dentry *d = list_entry(class_subdir_node,
1148     - struct dentry, d_u.d_child);
1149     + struct dentry, d_child);
1150    
1151     if (d->d_inode)
1152     if (d->d_inode->i_mode & S_IFDIR)
1153     diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
1154     index 06275f8807a8..4714ff92f15e 100644
1155     --- a/sound/pci/hda/patch_analog.c
1156     +++ b/sound/pci/hda/patch_analog.c
1157     @@ -332,6 +332,7 @@ static const struct hda_fixup ad1986a_fixups[] = {
1158    
1159     static const struct snd_pci_quirk ad1986a_fixup_tbl[] = {
1160     SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC),
1161     + SND_PCI_QUIRK(0x1043, 0x1443, "ASUS Z99He", AD1986A_FIXUP_EAPD),
1162     SND_PCI_QUIRK(0x1043, 0x1447, "ASUS A8JN", AD1986A_FIXUP_EAPD),
1163     SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK),
1164     SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8200, "ASUS M2", AD1986A_FIXUP_3STACK),
1165     diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1166     index b118a5be18df..c5ad83e4e0c7 100644
1167     --- a/sound/pci/hda/patch_realtek.c
1168     +++ b/sound/pci/hda/patch_realtek.c
1169     @@ -4887,6 +4887,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1170     SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
1171     SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
1172     SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1173     + SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
1174     SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
1175     SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1176     SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
1177     diff --git a/sound/usb/midi.c b/sound/usb/midi.c
1178     index d3d49525a16b..5bfb695547f8 100644
1179     --- a/sound/usb/midi.c
1180     +++ b/sound/usb/midi.c
1181     @@ -365,6 +365,8 @@ static void snd_usbmidi_error_timer(unsigned long data)
1182     if (in && in->error_resubmit) {
1183     in->error_resubmit = 0;
1184     for (j = 0; j < INPUT_URBS; ++j) {
1185     + if (atomic_read(&in->urbs[j]->use_count))
1186     + continue;
1187     in->urbs[j]->dev = umidi->dev;
1188     snd_usbmidi_submit_urb(in->urbs[j], GFP_ATOMIC);
1189     }