Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.4 commit in: /
Date: Mon, 07 Jul 2014 23:51:20
Message-Id: 1404776955.713c343a0ce53d7ca7edf8a0177795d066f151c6.mpagano@gentoo
1 commit: 713c343a0ce53d7ca7edf8a0177795d066f151c6
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 7 23:49:15 2014 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 7 23:49:15 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=713c343a
7
8 Linux patch 3.4.97
9
10 ---
11 0000_README | 4 +
12 1096_linux-3.4.97.patch | 552 ++++++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 556 insertions(+)
14
15 diff --git a/0000_README b/0000_README
16 index a4ce565..bacfd0f 100644
17 --- a/0000_README
18 +++ b/0000_README
19 @@ -423,6 +423,10 @@ Patch: 1095_linux-3.4.96.patch
20 From: http://www.kernel.org
21 Desc: Linux 3.4.96
22
23 +Patch: 1096_linux-3.4.97.patch
24 +From: http://www.kernel.org
25 +Desc: Linux 3.4.97
26 +
27 Patch: 1500_XATTR_USER_PREFIX.patch
28 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
29 Desc: Support for namespace user.pax.* on tmpfs.
30
31 diff --git a/1096_linux-3.4.97.patch b/1096_linux-3.4.97.patch
32 new file mode 100644
33 index 0000000..6007072
34 --- /dev/null
35 +++ b/1096_linux-3.4.97.patch
36 @@ -0,0 +1,552 @@
37 +diff --git a/Makefile b/Makefile
38 +index e4ecdedbfe27..fdd7c32ea1f7 100644
39 +--- a/Makefile
40 ++++ b/Makefile
41 +@@ -1,6 +1,6 @@
42 + VERSION = 3
43 + PATCHLEVEL = 4
44 +-SUBLEVEL = 96
45 ++SUBLEVEL = 97
46 + EXTRAVERSION =
47 + NAME = Saber-toothed Squirrel
48 +
49 +diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
50 +index 14ac52c5ae86..884de3433ad7 100644
51 +--- a/arch/mips/kernel/irq-msc01.c
52 ++++ b/arch/mips/kernel/irq-msc01.c
53 +@@ -131,7 +131,7 @@ void __init init_msc_irqs(unsigned long icubase, unsigned int irqbase, msc_irqma
54 +
55 + board_bind_eic_interrupt = &msc_bind_eic_interrupt;
56 +
57 +- for (; nirq >= 0; nirq--, imp++) {
58 ++ for (; nirq > 0; nirq--, imp++) {
59 + int n = imp->im_irq;
60 +
61 + switch (imp->im_type) {
62 +diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
63 +index e7dba0b2a170..eb6b72faec0d 100644
64 +--- a/arch/powerpc/kernel/time.c
65 ++++ b/arch/powerpc/kernel/time.c
66 +@@ -496,7 +496,7 @@ void timer_interrupt(struct pt_regs * regs)
67 +
68 + __get_cpu_var(irq_stat).timer_irqs++;
69 +
70 +-#if defined(CONFIG_PPC32) && defined(CONFIG_PMAC)
71 ++#if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC)
72 + if (atomic_read(&ppc_n_lost_interrupts) != 0)
73 + do_IRQ(regs);
74 + #endif
75 +diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
76 +index 9a52349874ee..e3b28e34bd78 100644
77 +--- a/arch/powerpc/lib/sstep.c
78 ++++ b/arch/powerpc/lib/sstep.c
79 +@@ -1395,7 +1395,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
80 + regs->gpr[rd] = byterev_4(val);
81 + goto ldst_done;
82 +
83 +-#ifdef CONFIG_PPC_CPU
84 ++#ifdef CONFIG_PPC_FPU
85 + case 535: /* lfsx */
86 + case 567: /* lfsux */
87 + if (!(regs->msr & MSR_FP))
88 +diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
89 +index 8a811d98a795..9c9e24512f28 100644
90 +--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
91 ++++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
92 +@@ -319,6 +319,7 @@ static int pseries_eeh_get_state(struct device_node *dn, int *state)
93 + } else {
94 + result = EEH_STATE_NOT_SUPPORT;
95 + }
96 ++ break;
97 + default:
98 + result = EEH_STATE_NOT_SUPPORT;
99 + }
100 +diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
101 +index 19f16ebaf4fa..0b60cd9dcf16 100644
102 +--- a/arch/x86/include/asm/ptrace.h
103 ++++ b/arch/x86/include/asm/ptrace.h
104 +@@ -286,6 +286,22 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
105 +
106 + #define ARCH_HAS_USER_SINGLE_STEP_INFO
107 +
108 ++/*
109 ++ * When hitting ptrace_stop(), we cannot return using SYSRET because
110 ++ * that does not restore the full CPU state, only a minimal set. The
111 ++ * ptracer can change arbitrary register values, which is usually okay
112 ++ * because the usual ptrace stops run off the signal delivery path which
113 ++ * forces IRET; however, ptrace_event() stops happen in arbitrary places
114 ++ * in the kernel and don't force IRET path.
115 ++ *
116 ++ * So force IRET path after a ptrace stop.
117 ++ */
118 ++#define arch_ptrace_stop_needed(code, info) \
119 ++({ \
120 ++ set_thread_flag(TIF_NOTIFY_RESUME); \
121 ++ false; \
122 ++})
123 ++
124 + struct user_desc;
125 + extern int do_get_thread_area(struct task_struct *p, int idx,
126 + struct user_desc __user *info);
127 +diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
128 +index f0d588f8859e..1acb99100556 100644
129 +--- a/drivers/infiniband/core/user_mad.c
130 ++++ b/drivers/infiniband/core/user_mad.c
131 +@@ -98,7 +98,7 @@ struct ib_umad_port {
132 +
133 + struct ib_umad_device {
134 + int start_port, end_port;
135 +- struct kref ref;
136 ++ struct kobject kobj;
137 + struct ib_umad_port port[0];
138 + };
139 +
140 +@@ -134,14 +134,18 @@ static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS);
141 + static void ib_umad_add_one(struct ib_device *device);
142 + static void ib_umad_remove_one(struct ib_device *device);
143 +
144 +-static void ib_umad_release_dev(struct kref *ref)
145 ++static void ib_umad_release_dev(struct kobject *kobj)
146 + {
147 + struct ib_umad_device *dev =
148 +- container_of(ref, struct ib_umad_device, ref);
149 ++ container_of(kobj, struct ib_umad_device, kobj);
150 +
151 + kfree(dev);
152 + }
153 +
154 ++static struct kobj_type ib_umad_dev_ktype = {
155 ++ .release = ib_umad_release_dev,
156 ++};
157 ++
158 + static int hdr_size(struct ib_umad_file *file)
159 + {
160 + return file->use_pkey_index ? sizeof (struct ib_user_mad_hdr) :
161 +@@ -780,27 +784,19 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
162 + {
163 + struct ib_umad_port *port;
164 + struct ib_umad_file *file;
165 +- int ret;
166 ++ int ret = -ENXIO;
167 +
168 + port = container_of(inode->i_cdev, struct ib_umad_port, cdev);
169 +- if (port)
170 +- kref_get(&port->umad_dev->ref);
171 +- else
172 +- return -ENXIO;
173 +
174 + mutex_lock(&port->file_mutex);
175 +
176 +- if (!port->ib_dev) {
177 +- ret = -ENXIO;
178 ++ if (!port->ib_dev)
179 + goto out;
180 +- }
181 +
182 ++ ret = -ENOMEM;
183 + file = kzalloc(sizeof *file, GFP_KERNEL);
184 +- if (!file) {
185 +- kref_put(&port->umad_dev->ref, ib_umad_release_dev);
186 +- ret = -ENOMEM;
187 ++ if (!file)
188 + goto out;
189 +- }
190 +
191 + mutex_init(&file->mutex);
192 + spin_lock_init(&file->send_lock);
193 +@@ -814,6 +810,13 @@ static int ib_umad_open(struct inode *inode, struct file *filp)
194 + list_add_tail(&file->port_list, &port->file_list);
195 +
196 + ret = nonseekable_open(inode, filp);
197 ++ if (ret) {
198 ++ list_del(&file->port_list);
199 ++ kfree(file);
200 ++ goto out;
201 ++ }
202 ++
203 ++ kobject_get(&port->umad_dev->kobj);
204 +
205 + out:
206 + mutex_unlock(&port->file_mutex);
207 +@@ -852,7 +855,7 @@ static int ib_umad_close(struct inode *inode, struct file *filp)
208 + mutex_unlock(&file->port->file_mutex);
209 +
210 + kfree(file);
211 +- kref_put(&dev->ref, ib_umad_release_dev);
212 ++ kobject_put(&dev->kobj);
213 +
214 + return 0;
215 + }
216 +@@ -880,10 +883,6 @@ static int ib_umad_sm_open(struct inode *inode, struct file *filp)
217 + int ret;
218 +
219 + port = container_of(inode->i_cdev, struct ib_umad_port, sm_cdev);
220 +- if (port)
221 +- kref_get(&port->umad_dev->ref);
222 +- else
223 +- return -ENXIO;
224 +
225 + if (filp->f_flags & O_NONBLOCK) {
226 + if (down_trylock(&port->sm_sem)) {
227 +@@ -898,17 +897,27 @@ static int ib_umad_sm_open(struct inode *inode, struct file *filp)
228 + }
229 +
230 + ret = ib_modify_port(port->ib_dev, port->port_num, 0, &props);
231 +- if (ret) {
232 +- up(&port->sm_sem);
233 +- goto fail;
234 +- }
235 ++ if (ret)
236 ++ goto err_up_sem;
237 +
238 + filp->private_data = port;
239 +
240 +- return nonseekable_open(inode, filp);
241 ++ ret = nonseekable_open(inode, filp);
242 ++ if (ret)
243 ++ goto err_clr_sm_cap;
244 ++
245 ++ kobject_get(&port->umad_dev->kobj);
246 ++
247 ++ return 0;
248 ++
249 ++err_clr_sm_cap:
250 ++ swap(props.set_port_cap_mask, props.clr_port_cap_mask);
251 ++ ib_modify_port(port->ib_dev, port->port_num, 0, &props);
252 ++
253 ++err_up_sem:
254 ++ up(&port->sm_sem);
255 +
256 + fail:
257 +- kref_put(&port->umad_dev->ref, ib_umad_release_dev);
258 + return ret;
259 + }
260 +
261 +@@ -927,7 +936,7 @@ static int ib_umad_sm_close(struct inode *inode, struct file *filp)
262 +
263 + up(&port->sm_sem);
264 +
265 +- kref_put(&port->umad_dev->ref, ib_umad_release_dev);
266 ++ kobject_put(&port->umad_dev->kobj);
267 +
268 + return ret;
269 + }
270 +@@ -995,6 +1004,7 @@ static int find_overflow_devnum(void)
271 + }
272 +
273 + static int ib_umad_init_port(struct ib_device *device, int port_num,
274 ++ struct ib_umad_device *umad_dev,
275 + struct ib_umad_port *port)
276 + {
277 + int devnum;
278 +@@ -1027,6 +1037,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
279 +
280 + cdev_init(&port->cdev, &umad_fops);
281 + port->cdev.owner = THIS_MODULE;
282 ++ port->cdev.kobj.parent = &umad_dev->kobj;
283 + kobject_set_name(&port->cdev.kobj, "umad%d", port->dev_num);
284 + if (cdev_add(&port->cdev, base, 1))
285 + goto err_cdev;
286 +@@ -1045,6 +1056,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
287 + base += IB_UMAD_MAX_PORTS;
288 + cdev_init(&port->sm_cdev, &umad_sm_fops);
289 + port->sm_cdev.owner = THIS_MODULE;
290 ++ port->sm_cdev.kobj.parent = &umad_dev->kobj;
291 + kobject_set_name(&port->sm_cdev.kobj, "issm%d", port->dev_num);
292 + if (cdev_add(&port->sm_cdev, base, 1))
293 + goto err_sm_cdev;
294 +@@ -1138,7 +1150,7 @@ static void ib_umad_add_one(struct ib_device *device)
295 + if (!umad_dev)
296 + return;
297 +
298 +- kref_init(&umad_dev->ref);
299 ++ kobject_init(&umad_dev->kobj, &ib_umad_dev_ktype);
300 +
301 + umad_dev->start_port = s;
302 + umad_dev->end_port = e;
303 +@@ -1146,7 +1158,8 @@ static void ib_umad_add_one(struct ib_device *device)
304 + for (i = s; i <= e; ++i) {
305 + umad_dev->port[i - s].umad_dev = umad_dev;
306 +
307 +- if (ib_umad_init_port(device, i, &umad_dev->port[i - s]))
308 ++ if (ib_umad_init_port(device, i, umad_dev,
309 ++ &umad_dev->port[i - s]))
310 + goto err;
311 + }
312 +
313 +@@ -1158,7 +1171,7 @@ err:
314 + while (--i >= s)
315 + ib_umad_kill_port(&umad_dev->port[i - s]);
316 +
317 +- kref_put(&umad_dev->ref, ib_umad_release_dev);
318 ++ kobject_put(&umad_dev->kobj);
319 + }
320 +
321 + static void ib_umad_remove_one(struct ib_device *device)
322 +@@ -1172,7 +1185,7 @@ static void ib_umad_remove_one(struct ib_device *device)
323 + for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i)
324 + ib_umad_kill_port(&umad_dev->port[i]);
325 +
326 +- kref_put(&umad_dev->ref, ib_umad_release_dev);
327 ++ kobject_put(&umad_dev->kobj);
328 + }
329 +
330 + static char *umad_devnode(struct device *dev, umode_t *mode)
331 +diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c
332 +index e2f9a51f4a38..45802e97332e 100644
333 +--- a/drivers/infiniband/hw/ipath/ipath_diag.c
334 ++++ b/drivers/infiniband/hw/ipath/ipath_diag.c
335 +@@ -346,6 +346,10 @@ static ssize_t ipath_diagpkt_write(struct file *fp,
336 + ret = -EFAULT;
337 + goto bail;
338 + }
339 ++ dp.len = odp.len;
340 ++ dp.unit = odp.unit;
341 ++ dp.data = odp.data;
342 ++ dp.pbc_wd = 0;
343 + } else {
344 + ret = -EINVAL;
345 + goto bail;
346 +diff --git a/drivers/infiniband/hw/qib/qib_mad.c b/drivers/infiniband/hw/qib/qib_mad.c
347 +index c4ff788823b5..14f39298cb97 100644
348 +--- a/drivers/infiniband/hw/qib/qib_mad.c
349 ++++ b/drivers/infiniband/hw/qib/qib_mad.c
350 +@@ -1005,7 +1005,7 @@ static int set_pkeys(struct qib_devdata *dd, u8 port, u16 *pkeys)
351 +
352 + event.event = IB_EVENT_PKEY_CHANGE;
353 + event.device = &dd->verbs_dev.ibdev;
354 +- event.element.port_num = 1;
355 ++ event.element.port_num = port;
356 + ib_dispatch_event(&event);
357 + }
358 + return 0;
359 +diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
360 +index 922d845f76b0..7fa948d7a867 100644
361 +--- a/drivers/infiniband/ulp/srp/ib_srp.c
362 ++++ b/drivers/infiniband/ulp/srp/ib_srp.c
363 +@@ -1371,6 +1371,12 @@ err_unmap:
364 + err_iu:
365 + srp_put_tx_iu(target, iu, SRP_IU_CMD);
366 +
367 ++ /*
368 ++ * Avoid that the loops that iterate over the request ring can
369 ++ * encounter a dangling SCSI command pointer.
370 ++ */
371 ++ req->scmnd = NULL;
372 ++
373 + spin_lock_irqsave(&target->lock, flags);
374 + list_add(&req->list, &target->free_reqs);
375 +
376 +diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
377 +index 9bdc3b8597a4..d93ea6417d15 100644
378 +--- a/drivers/input/mouse/elantech.c
379 ++++ b/drivers/input/mouse/elantech.c
380 +@@ -472,8 +472,15 @@ static void elantech_report_absolute_v3(struct psmouse *psmouse,
381 + input_report_key(dev, BTN_TOOL_FINGER, fingers == 1);
382 + input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2);
383 + input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3);
384 +- input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
385 +- input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
386 ++
387 ++ /* For clickpads map both buttons to BTN_LEFT */
388 ++ if (etd->fw_version & 0x001000) {
389 ++ input_report_key(dev, BTN_LEFT, packet[0] & 0x03);
390 ++ } else {
391 ++ input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
392 ++ input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
393 ++ }
394 ++
395 + input_report_abs(dev, ABS_PRESSURE, pres);
396 + input_report_abs(dev, ABS_TOOL_WIDTH, width);
397 +
398 +@@ -483,10 +490,17 @@ static void elantech_report_absolute_v3(struct psmouse *psmouse,
399 + static void elantech_input_sync_v4(struct psmouse *psmouse)
400 + {
401 + struct input_dev *dev = psmouse->dev;
402 ++ struct elantech_data *etd = psmouse->private;
403 + unsigned char *packet = psmouse->packet;
404 +
405 +- input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
406 +- input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
407 ++ /* For clickpads map both buttons to BTN_LEFT */
408 ++ if (etd->fw_version & 0x001000) {
409 ++ input_report_key(dev, BTN_LEFT, packet[0] & 0x03);
410 ++ } else {
411 ++ input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
412 ++ input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
413 ++ }
414 ++
415 + input_mt_report_pointer_emulation(dev, true);
416 + input_sync(dev);
417 + }
418 +diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
419 +index a7f6dcea0d76..4cdd2bc21403 100644
420 +--- a/drivers/pci/pci.c
421 ++++ b/drivers/pci/pci.c
422 +@@ -3610,7 +3610,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
423 + u16 cmd;
424 + int rc;
425 +
426 +- WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
427 ++ WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) && (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
428 +
429 + /* ARCH specific VGA enables */
430 + rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);
431 +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
432 +index 103c95e300fd..61bc33ed1116 100644
433 +--- a/drivers/pci/quirks.c
434 ++++ b/drivers/pci/quirks.c
435 +@@ -2921,6 +2921,7 @@ static void __devinit disable_igfx_irq(struct pci_dev *dev)
436 + }
437 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
438 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
439 ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
440 +
441 + static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
442 + struct pci_fixup *end)
443 +diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
444 +index bbb170e50055..a3b97e0c98df 100644
445 +--- a/drivers/watchdog/sp805_wdt.c
446 ++++ b/drivers/watchdog/sp805_wdt.c
447 +@@ -62,7 +62,6 @@
448 + * @adev: amba device structure of wdt
449 + * @status: current status of wdt
450 + * @load_val: load value to be set for current timeout
451 +- * @timeout: current programmed timeout
452 + */
453 + struct sp805_wdt {
454 + spinlock_t lock;
455 +@@ -73,7 +72,6 @@ struct sp805_wdt {
456 + #define WDT_BUSY 0
457 + #define WDT_CAN_BE_CLOSED 1
458 + unsigned int load_val;
459 +- unsigned int timeout;
460 + };
461 +
462 + /* local variables */
463 +@@ -101,7 +99,7 @@ static void wdt_setload(unsigned int timeout)
464 + spin_lock(&wdt->lock);
465 + wdt->load_val = load;
466 + /* roundup timeout to closest positive integer value */
467 +- wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
468 ++ wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
469 + spin_unlock(&wdt->lock);
470 + }
471 +
472 +diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
473 +index 28e5648c9cc4..a4b87c69fbbb 100644
474 +--- a/fs/nfsd/nfs4state.c
475 ++++ b/fs/nfsd/nfs4state.c
476 +@@ -3485,7 +3485,7 @@ nfsd4_free_lock_stateid(struct nfs4_ol_stateid *stp)
477 + * correspondance, and we have to delete the lockowner when we
478 + * delete the lock stateid:
479 + */
480 +- unhash_lockowner(lo);
481 ++ release_lockowner(lo);
482 + return nfs_ok;
483 + }
484 +
485 +diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
486 +index 6eaa2e2335dc..ba7bf4a11855 100644
487 +--- a/fs/nfsd/nfs4xdr.c
488 ++++ b/fs/nfsd/nfs4xdr.c
489 +@@ -2032,8 +2032,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
490 + err = vfs_getattr(exp->ex_path.mnt, dentry, &stat);
491 + if (err)
492 + goto out_nfserr;
493 +- if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL |
494 +- FATTR4_WORD0_MAXNAME)) ||
495 ++ if ((bmval0 & (FATTR4_WORD0_FILES_AVAIL | FATTR4_WORD0_FILES_FREE |
496 ++ FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_MAXNAME)) ||
497 + (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE |
498 + FATTR4_WORD1_SPACE_TOTAL))) {
499 + err = vfs_statfs(&path, &statfs);
500 +diff --git a/fs/ubifs/shrinker.c b/fs/ubifs/shrinker.c
501 +index 9e1d05666fed..e0a7a764a903 100644
502 +--- a/fs/ubifs/shrinker.c
503 ++++ b/fs/ubifs/shrinker.c
504 +@@ -128,7 +128,6 @@ static int shrink_tnc(struct ubifs_info *c, int nr, int age, int *contention)
505 + freed = ubifs_destroy_tnc_subtree(znode);
506 + atomic_long_sub(freed, &ubifs_clean_zn_cnt);
507 + atomic_long_sub(freed, &c->clean_zn_cnt);
508 +- ubifs_assert(atomic_long_read(&c->clean_zn_cnt) >= 0);
509 + total_freed += freed;
510 + znode = zprev;
511 + }
512 +diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
513 +index 5c719627c2aa..ed12724901bc 100644
514 +--- a/include/linux/ptrace.h
515 ++++ b/include/linux/ptrace.h
516 +@@ -379,6 +379,9 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
517 + * calling arch_ptrace_stop() when it would be superfluous. For example,
518 + * if the thread has not been back to user mode since the last stop, the
519 + * thread state might indicate that nothing needs to be done.
520 ++ *
521 ++ * This is guaranteed to be invoked once before a task stops for ptrace and
522 ++ * may include arch-specific operations necessary prior to a ptrace stop.
523 + */
524 + #define arch_ptrace_stop_needed(code, info) (0)
525 + #endif
526 +diff --git a/include/trace/syscall.h b/include/trace/syscall.h
527 +index 31966a4fb8cc..51b72d8a8498 100644
528 +--- a/include/trace/syscall.h
529 ++++ b/include/trace/syscall.h
530 +@@ -4,6 +4,7 @@
531 + #include <linux/tracepoint.h>
532 + #include <linux/unistd.h>
533 + #include <linux/ftrace_event.h>
534 ++#include <linux/thread_info.h>
535 +
536 + #include <asm/ptrace.h>
537 +
538 +@@ -54,4 +55,18 @@ int perf_sysexit_enable(struct ftrace_event_call *call);
539 + void perf_sysexit_disable(struct ftrace_event_call *call);
540 + #endif
541 +
542 ++#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
543 ++static inline void syscall_tracepoint_update(struct task_struct *p)
544 ++{
545 ++ if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
546 ++ set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
547 ++ else
548 ++ clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
549 ++}
550 ++#else
551 ++static inline void syscall_tracepoint_update(struct task_struct *p)
552 ++{
553 ++}
554 ++#endif
555 ++
556 + #endif /* _TRACE_SYSCALL_H */
557 +diff --git a/kernel/fork.c b/kernel/fork.c
558 +index afac42b8889c..621c547dabb1 100644
559 +--- a/kernel/fork.c
560 ++++ b/kernel/fork.c
561 +@@ -1441,7 +1441,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
562 +
563 + total_forks++;
564 + spin_unlock(&current->sighand->siglock);
565 ++ syscall_tracepoint_update(p);
566 + write_unlock_irq(&tasklist_lock);
567 ++
568 + proc_fork_connector(p);
569 + cgroup_post_fork(p);
570 + if (clone_flags & CLONE_THREAD)
571 +diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
572 +index 54e35c1e5948..5e29610303b0 100644
573 +--- a/scripts/recordmcount.h
574 ++++ b/scripts/recordmcount.h
575 +@@ -163,11 +163,11 @@ static int mcount_adjust = 0;
576 +
577 + static int MIPS_is_fake_mcount(Elf_Rel const *rp)
578 + {
579 +- static Elf_Addr old_r_offset;
580 ++ static Elf_Addr old_r_offset = ~(Elf_Addr)0;
581 + Elf_Addr current_r_offset = _w(rp->r_offset);
582 + int is_fake;
583 +
584 +- is_fake = old_r_offset &&
585 ++ is_fake = (old_r_offset != ~(Elf_Addr)0) &&
586 + (current_r_offset - old_r_offset == MIPS_FAKEMCOUNT_OFFSET);
587 + old_r_offset = current_r_offset;
588 +