Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Thu, 10 Jun 2021 11:10:41
Message-Id: 1623323426.1538f48d5f26e4906ebbdc0d1582596d52f3c836.mpagano@gentoo
1 commit: 1538f48d5f26e4906ebbdc0d1582596d52f3c836
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 10 11:10:26 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 10 11:10:26 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=1538f48d
7
8 Linux patch 4.9.272
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1271_linux-4.9.272.patch | 925 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 929 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index bb0f7b4..1400163 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1127,6 +1127,10 @@ Patch: 1270_linux-4.9.271.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.9.271
23
24 +Patch: 1271_linux-4.9.272.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.9.272
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1271_linux-4.9.272.patch b/1271_linux-4.9.272.patch
33 new file mode 100644
34 index 0000000..ede0c1e
35 --- /dev/null
36 +++ b/1271_linux-4.9.272.patch
37 @@ -0,0 +1,925 @@
38 +diff --git a/Makefile b/Makefile
39 +index 4964c2494edb5..39aa8b66fc6ff 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 9
45 +-SUBLEVEL = 271
46 ++SUBLEVEL = 272
47 + EXTRAVERSION =
48 + NAME = Roaring Lionus
49 +
50 +diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
51 +index 5962badb33462..b6fd2a21b015e 100644
52 +--- a/arch/arm64/kernel/traps.c
53 ++++ b/arch/arm64/kernel/traps.c
54 +@@ -543,14 +543,6 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
55 + }
56 + #endif
57 +
58 +- if (show_unhandled_signals_ratelimited()) {
59 +- pr_info("%s[%d]: syscall %d\n", current->comm,
60 +- task_pid_nr(current), (int)regs->syscallno);
61 +- dump_instr("", regs);
62 +- if (user_mode(regs))
63 +- __show_regs(regs);
64 +- }
65 +-
66 + return sys_ni_syscall();
67 + }
68 +
69 +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
70 +index 29078eaf18c9b..cbc7f177bbd8e 100644
71 +--- a/arch/x86/kvm/svm.c
72 ++++ b/arch/x86/kvm/svm.c
73 +@@ -3412,7 +3412,7 @@ static int cr_interception(struct vcpu_svm *svm)
74 + err = 0;
75 + if (cr >= 16) { /* mov to cr */
76 + cr -= 16;
77 +- val = kvm_register_read(&svm->vcpu, reg);
78 ++ val = kvm_register_readl(&svm->vcpu, reg);
79 + switch (cr) {
80 + case 0:
81 + if (!check_selective_cr0_intercepted(svm, val))
82 +@@ -3457,7 +3457,7 @@ static int cr_interception(struct vcpu_svm *svm)
83 + kvm_queue_exception(&svm->vcpu, UD_VECTOR);
84 + return 1;
85 + }
86 +- kvm_register_write(&svm->vcpu, reg, val);
87 ++ kvm_register_writel(&svm->vcpu, reg, val);
88 + }
89 + kvm_complete_insn_gp(&svm->vcpu, err);
90 +
91 +@@ -3489,13 +3489,13 @@ static int dr_interception(struct vcpu_svm *svm)
92 + if (dr >= 16) { /* mov to DRn */
93 + if (!kvm_require_dr(&svm->vcpu, dr - 16))
94 + return 1;
95 +- val = kvm_register_read(&svm->vcpu, reg);
96 ++ val = kvm_register_readl(&svm->vcpu, reg);
97 + kvm_set_dr(&svm->vcpu, dr - 16, val);
98 + } else {
99 + if (!kvm_require_dr(&svm->vcpu, dr))
100 + return 1;
101 + kvm_get_dr(&svm->vcpu, dr, &val);
102 +- kvm_register_write(&svm->vcpu, reg, val);
103 ++ kvm_register_writel(&svm->vcpu, reg, val);
104 + }
105 +
106 + skip_emulated_instruction(&svm->vcpu);
107 +diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
108 +index c0e54396f2502..dc8d2603612ed 100644
109 +--- a/drivers/firmware/efi/cper.c
110 ++++ b/drivers/firmware/efi/cper.c
111 +@@ -257,8 +257,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
112 + if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
113 + return 0;
114 +
115 +- n = 0;
116 +- len = CPER_REC_LEN - 1;
117 ++ len = CPER_REC_LEN;
118 + dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
119 + if (bank && device)
120 + n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
121 +@@ -267,7 +266,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
122 + "DIMM location: not present. DMI handle: 0x%.4x ",
123 + mem->mem_dev_handle);
124 +
125 +- msg[n] = '\0';
126 + return n;
127 + }
128 +
129 +diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c
130 +index 9faa09e7c31f1..c2b991b9fa9e6 100644
131 +--- a/drivers/firmware/efi/memattr.c
132 ++++ b/drivers/firmware/efi/memattr.c
133 +@@ -68,11 +68,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
134 + return false;
135 + }
136 +
137 +- if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
138 +- pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
139 +- return false;
140 +- }
141 +-
142 + if (PAGE_SIZE > EFI_PAGE_SIZE &&
143 + (!PAGE_ALIGNED(in->phys_addr) ||
144 + !PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
145 +diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
146 +index 606fd875740c0..800c477dd0761 100644
147 +--- a/drivers/hid/i2c-hid/i2c-hid-core.c
148 ++++ b/drivers/hid/i2c-hid/i2c-hid-core.c
149 +@@ -1157,8 +1157,8 @@ static int i2c_hid_probe(struct i2c_client *client,
150 + hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
151 + hid->product = le16_to_cpu(ihid->hdesc.wProductID);
152 +
153 +- snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
154 +- client->name, hid->vendor, hid->product);
155 ++ snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X",
156 ++ client->name, (u16)hid->vendor, (u16)hid->product);
157 + strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
158 +
159 + ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product);
160 +diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
161 +index 08174d341f4a1..bc75f1efa0f4c 100644
162 +--- a/drivers/hid/usbhid/hid-pidff.c
163 ++++ b/drivers/hid/usbhid/hid-pidff.c
164 +@@ -1304,6 +1304,7 @@ int hid_pidff_init(struct hid_device *hid)
165 +
166 + if (pidff->pool[PID_DEVICE_MANAGED_POOL].value &&
167 + pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) {
168 ++ error = -EPERM;
169 + hid_notice(hid,
170 + "device does not support device managed pool\n");
171 + goto fail;
172 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
173 +index 148e1ff2e5e0e..77dadbe1a4464 100644
174 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
175 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
176 +@@ -4262,7 +4262,6 @@ int bnxt_hwrm_func_qcaps(struct bnxt *bp)
177 +
178 + pf->fw_fid = le16_to_cpu(resp->fid);
179 + pf->port_id = le16_to_cpu(resp->port_id);
180 +- bp->dev->dev_port = pf->port_id;
181 + memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
182 + memcpy(bp->dev->dev_addr, pf->mac_addr, ETH_ALEN);
183 + pf->max_rsscos_ctxs = le16_to_cpu(resp->max_rsscos_ctx);
184 +diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
185 +index d418542924e16..297d3f599efda 100644
186 +--- a/drivers/net/usb/cdc_ncm.c
187 ++++ b/drivers/net/usb/cdc_ncm.c
188 +@@ -1563,6 +1563,15 @@ cdc_ncm_speed_change(struct usbnet *dev,
189 + uint32_t rx_speed = le32_to_cpu(data->DLBitRRate);
190 + uint32_t tx_speed = le32_to_cpu(data->ULBitRate);
191 +
192 ++ /* if the speed hasn't changed, don't report it.
193 ++ * RTL8156 shipped before 2021 sends notification about every 32ms.
194 ++ */
195 ++ if (dev->rx_speed == rx_speed && dev->tx_speed == tx_speed)
196 ++ return;
197 ++
198 ++ dev->rx_speed = rx_speed;
199 ++ dev->tx_speed = tx_speed;
200 ++
201 + /*
202 + * Currently the USB-NET API does not support reporting the actual
203 + * device speed. Do print it instead.
204 +@@ -1606,7 +1615,8 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
205 + * USB_CDC_NOTIFY_NETWORK_CONNECTION notification shall be
206 + * sent by device after USB_CDC_NOTIFY_SPEED_CHANGE.
207 + */
208 +- usbnet_link_change(dev, !!event->wValue, 0);
209 ++ if (netif_carrier_ok(dev->net) != !!event->wValue)
210 ++ usbnet_link_change(dev, !!event->wValue, 0);
211 + break;
212 +
213 + case USB_CDC_NOTIFY_SPEED_CHANGE:
214 +diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
215 +index 24ee2605b9f04..0da884bfc7a80 100644
216 +--- a/drivers/vfio/pci/Kconfig
217 ++++ b/drivers/vfio/pci/Kconfig
218 +@@ -1,6 +1,7 @@
219 + config VFIO_PCI
220 + tristate "VFIO support for PCI devices"
221 + depends on VFIO && PCI && EVENTFD
222 ++ depends on MMU
223 + select VFIO_VIRQFD
224 + select IRQ_BYPASS_MANAGER
225 + help
226 +diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
227 +index f3c2de04b20d3..5b0f09b211bee 100644
228 +--- a/drivers/vfio/pci/vfio_pci_config.c
229 ++++ b/drivers/vfio/pci/vfio_pci_config.c
230 +@@ -1576,7 +1576,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
231 + if (len == 0xFF) {
232 + len = vfio_ext_cap_len(vdev, ecap, epos);
233 + if (len < 0)
234 +- return ret;
235 ++ return len;
236 + }
237 + }
238 +
239 +diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
240 +index d143d08c4f0fe..9b1b6c1e218dc 100644
241 +--- a/drivers/vfio/platform/vfio_platform_common.c
242 ++++ b/drivers/vfio/platform/vfio_platform_common.c
243 +@@ -288,7 +288,7 @@ err_irq:
244 + vfio_platform_regions_cleanup(vdev);
245 + err_reg:
246 + mutex_unlock(&driver_lock);
247 +- module_put(THIS_MODULE);
248 ++ module_put(vdev->parent_module);
249 + return ret;
250 + }
251 +
252 +diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c
253 +index c99f8bb1c56c4..e6c7509a3d873 100644
254 +--- a/drivers/xen/xen-pciback/vpci.c
255 ++++ b/drivers/xen/xen-pciback/vpci.c
256 +@@ -68,7 +68,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
257 + struct pci_dev *dev, int devid,
258 + publish_pci_dev_cb publish_cb)
259 + {
260 +- int err = 0, slot, func = -1;
261 ++ int err = 0, slot, func = PCI_FUNC(dev->devfn);
262 + struct pci_dev_entry *t, *dev_entry;
263 + struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
264 +
265 +@@ -93,23 +93,26 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
266 +
267 + /*
268 + * Keep multi-function devices together on the virtual PCI bus, except
269 +- * virtual functions.
270 ++ * that we want to keep virtual functions at func 0 on their own. They
271 ++ * aren't multi-function devices and hence their presence at func 0
272 ++ * may cause guests to not scan the other functions.
273 + */
274 +- if (!dev->is_virtfn) {
275 ++ if (!dev->is_virtfn || func) {
276 + for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
277 + if (list_empty(&vpci_dev->dev_list[slot]))
278 + continue;
279 +
280 + t = list_entry(list_first(&vpci_dev->dev_list[slot]),
281 + struct pci_dev_entry, list);
282 ++ if (t->dev->is_virtfn && !PCI_FUNC(t->dev->devfn))
283 ++ continue;
284 +
285 + if (match_slot(dev, t->dev)) {
286 + pr_info("vpci: %s: assign to virtual slot %d func %d\n",
287 + pci_name(dev), slot,
288 +- PCI_FUNC(dev->devfn));
289 ++ func);
290 + list_add_tail(&dev_entry->list,
291 + &vpci_dev->dev_list[slot]);
292 +- func = PCI_FUNC(dev->devfn);
293 + goto unlock;
294 + }
295 + }
296 +@@ -122,7 +125,6 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev,
297 + pci_name(dev), slot);
298 + list_add_tail(&dev_entry->list,
299 + &vpci_dev->dev_list[slot]);
300 +- func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
301 + goto unlock;
302 + }
303 + }
304 +diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
305 +index 4f919628137cb..374d91830a900 100644
306 +--- a/fs/btrfs/file-item.c
307 ++++ b/fs/btrfs/file-item.c
308 +@@ -608,7 +608,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
309 + u64 end_byte = bytenr + len;
310 + u64 csum_end;
311 + struct extent_buffer *leaf;
312 +- int ret;
313 ++ int ret = 0;
314 + u16 csum_size = btrfs_super_csum_size(root->fs_info->super_copy);
315 + int blocksize_bits = root->fs_info->sb->s_blocksize_bits;
316 +
317 +@@ -626,6 +626,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
318 + path->leave_spinning = 1;
319 + ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
320 + if (ret > 0) {
321 ++ ret = 0;
322 + if (path->slots[0] == 0)
323 + break;
324 + path->slots[0]--;
325 +@@ -656,7 +657,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
326 + if (key.offset >= bytenr && csum_end <= end_byte) {
327 + ret = btrfs_del_item(trans, root, path);
328 + if (ret)
329 +- goto out;
330 ++ break;
331 + if (key.offset == bytenr)
332 + break;
333 + } else if (key.offset < bytenr && csum_end > end_byte) {
334 +@@ -700,8 +701,9 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
335 + ret = btrfs_split_item(trans, root, path, &key, offset);
336 + if (ret && ret != -EAGAIN) {
337 + btrfs_abort_transaction(trans, ret);
338 +- goto out;
339 ++ break;
340 + }
341 ++ ret = 0;
342 +
343 + key.offset = end_byte - 1;
344 + } else {
345 +@@ -711,8 +713,6 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
346 + }
347 + btrfs_release_path(path);
348 + }
349 +- ret = 0;
350 +-out:
351 + btrfs_free_path(path);
352 + return ret;
353 + }
354 +diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
355 +index 5c86fecaf167e..11ecd798864c8 100644
356 +--- a/fs/btrfs/tree-log.c
357 ++++ b/fs/btrfs/tree-log.c
358 +@@ -1529,6 +1529,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
359 + break;
360 +
361 + if (ret == 1) {
362 ++ ret = 0;
363 + if (path->slots[0] == 0)
364 + break;
365 + path->slots[0]--;
366 +@@ -1541,17 +1542,19 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
367 +
368 + ret = btrfs_del_item(trans, root, path);
369 + if (ret)
370 +- goto out;
371 ++ break;
372 +
373 + btrfs_release_path(path);
374 + inode = read_one_inode(root, key.offset);
375 +- if (!inode)
376 +- return -EIO;
377 ++ if (!inode) {
378 ++ ret = -EIO;
379 ++ break;
380 ++ }
381 +
382 + ret = fixup_inode_link_count(trans, root, inode);
383 + iput(inode);
384 + if (ret)
385 +- goto out;
386 ++ break;
387 +
388 + /*
389 + * fixup on a directory may create new entries,
390 +@@ -1560,8 +1563,6 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
391 + */
392 + key.offset = (u64)-1;
393 + }
394 +- ret = 0;
395 +-out:
396 + btrfs_release_path(path);
397 + return ret;
398 + }
399 +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
400 +index 7f291b7be7f3a..e2f31aee67c28 100644
401 +--- a/fs/ext4/extents.c
402 ++++ b/fs/ext4/extents.c
403 +@@ -3274,7 +3274,10 @@ static int ext4_split_extent_at(handle_t *handle,
404 + ext4_ext_mark_unwritten(ex2);
405 +
406 + err = ext4_ext_insert_extent(handle, inode, ppath, &newex, flags);
407 +- if (err == -ENOSPC && (EXT4_EXT_MAY_ZEROOUT & split_flag)) {
408 ++ if (err != -ENOSPC && err != -EDQUOT)
409 ++ goto out;
410 ++
411 ++ if (EXT4_EXT_MAY_ZEROOUT & split_flag) {
412 + if (split_flag & (EXT4_EXT_DATA_VALID1|EXT4_EXT_DATA_VALID2)) {
413 + if (split_flag & EXT4_EXT_DATA_VALID1) {
414 + err = ext4_ext_zeroout(inode, ex2);
415 +@@ -3300,30 +3303,30 @@ static int ext4_split_extent_at(handle_t *handle,
416 + ext4_ext_pblock(&orig_ex));
417 + }
418 +
419 +- if (err)
420 +- goto fix_extent_len;
421 +- /* update the extent length and mark as initialized */
422 +- ex->ee_len = cpu_to_le16(ee_len);
423 +- ext4_ext_try_to_merge(handle, inode, path, ex);
424 +- err = ext4_ext_dirty(handle, inode, path + path->p_depth);
425 +- if (err)
426 +- goto fix_extent_len;
427 +-
428 +- /* update extent status tree */
429 +- err = ext4_zeroout_es(inode, &zero_ex);
430 +-
431 +- goto out;
432 +- } else if (err)
433 +- goto fix_extent_len;
434 +-
435 +-out:
436 +- ext4_ext_show_leaf(inode, path);
437 +- return err;
438 ++ if (!err) {
439 ++ /* update the extent length and mark as initialized */
440 ++ ex->ee_len = cpu_to_le16(ee_len);
441 ++ ext4_ext_try_to_merge(handle, inode, path, ex);
442 ++ err = ext4_ext_dirty(handle, inode, path + path->p_depth);
443 ++ if (!err)
444 ++ /* update extent status tree */
445 ++ err = ext4_zeroout_es(inode, &zero_ex);
446 ++ /* If we failed at this point, we don't know in which
447 ++ * state the extent tree exactly is so don't try to fix
448 ++ * length of the original extent as it may do even more
449 ++ * damage.
450 ++ */
451 ++ goto out;
452 ++ }
453 ++ }
454 +
455 + fix_extent_len:
456 + ex->ee_len = orig_ex.ee_len;
457 + ext4_ext_dirty(handle, inode, path + path->p_depth);
458 + return err;
459 ++out:
460 ++ ext4_ext_show_leaf(inode, path);
461 ++ return err;
462 + }
463 +
464 + /*
465 +diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
466 +index c17285df12be2..3aa4441f5ab50 100644
467 +--- a/fs/ocfs2/file.c
468 ++++ b/fs/ocfs2/file.c
469 +@@ -1838,6 +1838,45 @@ out:
470 + return ret;
471 + }
472 +
473 ++/*
474 ++ * zero out partial blocks of one cluster.
475 ++ *
476 ++ * start: file offset where zero starts, will be made upper block aligned.
477 ++ * len: it will be trimmed to the end of current cluster if "start + len"
478 ++ * is bigger than it.
479 ++ */
480 ++static int ocfs2_zeroout_partial_cluster(struct inode *inode,
481 ++ u64 start, u64 len)
482 ++{
483 ++ int ret;
484 ++ u64 start_block, end_block, nr_blocks;
485 ++ u64 p_block, offset;
486 ++ u32 cluster, p_cluster, nr_clusters;
487 ++ struct super_block *sb = inode->i_sb;
488 ++ u64 end = ocfs2_align_bytes_to_clusters(sb, start);
489 ++
490 ++ if (start + len < end)
491 ++ end = start + len;
492 ++
493 ++ start_block = ocfs2_blocks_for_bytes(sb, start);
494 ++ end_block = ocfs2_blocks_for_bytes(sb, end);
495 ++ nr_blocks = end_block - start_block;
496 ++ if (!nr_blocks)
497 ++ return 0;
498 ++
499 ++ cluster = ocfs2_bytes_to_clusters(sb, start);
500 ++ ret = ocfs2_get_clusters(inode, cluster, &p_cluster,
501 ++ &nr_clusters, NULL);
502 ++ if (ret)
503 ++ return ret;
504 ++ if (!p_cluster)
505 ++ return 0;
506 ++
507 ++ offset = start_block - ocfs2_clusters_to_blocks(sb, cluster);
508 ++ p_block = ocfs2_clusters_to_blocks(sb, p_cluster) + offset;
509 ++ return sb_issue_zeroout(sb, p_block, nr_blocks, GFP_NOFS);
510 ++}
511 ++
512 + /*
513 + * Parts of this function taken from xfs_change_file_space()
514 + */
515 +@@ -1848,7 +1887,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
516 + {
517 + int ret;
518 + s64 llen;
519 +- loff_t size;
520 ++ loff_t size, orig_isize;
521 + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
522 + struct buffer_head *di_bh = NULL;
523 + handle_t *handle;
524 +@@ -1879,6 +1918,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
525 + goto out_inode_unlock;
526 + }
527 +
528 ++ orig_isize = i_size_read(inode);
529 + switch (sr->l_whence) {
530 + case 0: /*SEEK_SET*/
531 + break;
532 +@@ -1886,7 +1926,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
533 + sr->l_start += f_pos;
534 + break;
535 + case 2: /*SEEK_END*/
536 +- sr->l_start += i_size_read(inode);
537 ++ sr->l_start += orig_isize;
538 + break;
539 + default:
540 + ret = -EINVAL;
541 +@@ -1940,6 +1980,14 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
542 + default:
543 + ret = -EINVAL;
544 + }
545 ++
546 ++ /* zeroout eof blocks in the cluster. */
547 ++ if (!ret && change_size && orig_isize < size) {
548 ++ ret = ocfs2_zeroout_partial_cluster(inode, orig_isize,
549 ++ size - orig_isize);
550 ++ if (!ret)
551 ++ i_size_write(inode, size);
552 ++ }
553 + up_write(&OCFS2_I(inode)->ip_alloc_sem);
554 + if (ret) {
555 + mlog_errno(ret);
556 +@@ -1956,9 +2004,6 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
557 + goto out_inode_unlock;
558 + }
559 +
560 +- if (change_size && i_size_read(inode) < size)
561 +- i_size_write(inode, size);
562 +-
563 + inode->i_ctime = inode->i_mtime = current_time(inode);
564 + ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
565 + if (ret < 0)
566 +diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
567 +index fde7550754df6..52f47c2944f84 100644
568 +--- a/include/linux/usb/usbnet.h
569 ++++ b/include/linux/usb/usbnet.h
570 +@@ -80,6 +80,8 @@ struct usbnet {
571 + # define EVENT_LINK_CHANGE 11
572 + # define EVENT_SET_RX_MODE 12
573 + # define EVENT_NO_IP_ALIGN 13
574 ++ u32 rx_speed; /* in bps - NOT Mbps */
575 ++ u32 tx_speed; /* in bps - NOT Mbps */
576 + };
577 +
578 + static inline struct usb_driver *driver_of(struct usb_interface *intf)
579 +diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h
580 +index 028b754ae9b17..0baf2e21a533f 100644
581 +--- a/include/net/caif/caif_dev.h
582 ++++ b/include/net/caif/caif_dev.h
583 +@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *adap_layer);
584 + * The link_support layer is used to add any Link Layer specific
585 + * framing.
586 + */
587 +-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
588 ++int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
589 + struct cflayer *link_support, int head_room,
590 + struct cflayer **layer, int (**rcv_func)(
591 + struct sk_buff *, struct net_device *,
592 +diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h
593 +index 70bfd017581fb..219094ace893c 100644
594 +--- a/include/net/caif/cfcnfg.h
595 ++++ b/include/net/caif/cfcnfg.h
596 +@@ -62,7 +62,7 @@ void cfcnfg_remove(struct cfcnfg *cfg);
597 + * @fcs: Specify if checksum is used in CAIF Framing Layer.
598 + * @head_room: Head space needed by link specific protocol.
599 + */
600 +-void
601 ++int
602 + cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
603 + struct net_device *dev, struct cflayer *phy_layer,
604 + enum cfcnfg_phy_preference pref,
605 +diff --git a/include/net/caif/cfserl.h b/include/net/caif/cfserl.h
606 +index b5b020f3c72eb..bc3fae07a25f9 100644
607 +--- a/include/net/caif/cfserl.h
608 ++++ b/include/net/caif/cfserl.h
609 +@@ -9,4 +9,5 @@
610 + #include <net/caif/caif_layer.h>
611 +
612 + struct cflayer *cfserl_create(int instance, bool use_stx);
613 ++void cfserl_release(struct cflayer *layer);
614 + #endif
615 +diff --git a/init/main.c b/init/main.c
616 +index 7ad08957dd180..9e057314a15f3 100644
617 +--- a/init/main.c
618 ++++ b/init/main.c
619 +@@ -1005,7 +1005,7 @@ static noinline void __init kernel_init_freeable(void)
620 + */
621 + set_cpus_allowed_ptr(current, cpu_all_mask);
622 +
623 +- cad_pid = task_pid(current);
624 ++ cad_pid = get_pid(task_pid(current));
625 +
626 + smp_prepare_cpus(setup_max_cpus);
627 +
628 +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
629 +index 02f44a408edbd..839c534bdcdb9 100644
630 +--- a/net/bluetooth/hci_core.c
631 ++++ b/net/bluetooth/hci_core.c
632 +@@ -1422,8 +1422,13 @@ static int hci_dev_do_open(struct hci_dev *hdev)
633 + } else {
634 + /* Init failed, cleanup */
635 + flush_work(&hdev->tx_work);
636 +- flush_work(&hdev->cmd_work);
637 ++
638 ++ /* Since hci_rx_work() is possible to awake new cmd_work
639 ++ * it should be flushed first to avoid unexpected call of
640 ++ * hci_cmd_work()
641 ++ */
642 + flush_work(&hdev->rx_work);
643 ++ flush_work(&hdev->cmd_work);
644 +
645 + skb_queue_purge(&hdev->cmd_q);
646 + skb_queue_purge(&hdev->rx_q);
647 +diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
648 +index 44b3146c61175..35f5585188de7 100644
649 +--- a/net/bluetooth/hci_sock.c
650 ++++ b/net/bluetooth/hci_sock.c
651 +@@ -750,7 +750,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
652 + /* Detach sockets from device */
653 + read_lock(&hci_sk_list.lock);
654 + sk_for_each(sk, &hci_sk_list.head) {
655 +- bh_lock_sock_nested(sk);
656 ++ lock_sock(sk);
657 + if (hci_pi(sk)->hdev == hdev) {
658 + hci_pi(sk)->hdev = NULL;
659 + sk->sk_err = EPIPE;
660 +@@ -759,7 +759,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
661 +
662 + hci_dev_put(hdev);
663 + }
664 +- bh_unlock_sock(sk);
665 ++ release_sock(sk);
666 + }
667 + read_unlock(&hci_sk_list.lock);
668 + }
669 +diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
670 +index a0443d40d677c..a28ffbbf7450c 100644
671 +--- a/net/caif/caif_dev.c
672 ++++ b/net/caif/caif_dev.c
673 +@@ -303,7 +303,7 @@ static void dev_flowctrl(struct net_device *dev, int on)
674 + caifd_put(caifd);
675 + }
676 +
677 +-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
678 ++int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
679 + struct cflayer *link_support, int head_room,
680 + struct cflayer **layer,
681 + int (**rcv_func)(struct sk_buff *, struct net_device *,
682 +@@ -314,11 +314,12 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
683 + enum cfcnfg_phy_preference pref;
684 + struct cfcnfg *cfg = get_cfcnfg(dev_net(dev));
685 + struct caif_device_entry_list *caifdevs;
686 ++ int res;
687 +
688 + caifdevs = caif_device_list(dev_net(dev));
689 + caifd = caif_device_alloc(dev);
690 + if (!caifd)
691 +- return;
692 ++ return -ENOMEM;
693 + *layer = &caifd->layer;
694 + spin_lock_init(&caifd->flow_lock);
695 +
696 +@@ -340,7 +341,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
697 + sizeof(caifd->layer.name) - 1);
698 + caifd->layer.name[sizeof(caifd->layer.name) - 1] = 0;
699 + caifd->layer.transmit = transmit;
700 +- cfcnfg_add_phy_layer(cfg,
701 ++ res = cfcnfg_add_phy_layer(cfg,
702 + dev,
703 + &caifd->layer,
704 + pref,
705 +@@ -350,6 +351,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
706 + mutex_unlock(&caifdevs->lock);
707 + if (rcv_func)
708 + *rcv_func = receive;
709 ++ return res;
710 + }
711 + EXPORT_SYMBOL(caif_enroll_dev);
712 +
713 +@@ -364,6 +366,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
714 + struct cflayer *layer, *link_support;
715 + int head_room = 0;
716 + struct caif_device_entry_list *caifdevs;
717 ++ int res;
718 +
719 + cfg = get_cfcnfg(dev_net(dev));
720 + caifdevs = caif_device_list(dev_net(dev));
721 +@@ -389,8 +392,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
722 + break;
723 + }
724 + }
725 +- caif_enroll_dev(dev, caifdev, link_support, head_room,
726 ++ res = caif_enroll_dev(dev, caifdev, link_support, head_room,
727 + &layer, NULL);
728 ++ if (res)
729 ++ cfserl_release(link_support);
730 + caifdev->flowctrl = dev_flowctrl;
731 + break;
732 +
733 +diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
734 +index 5cd44f001f647..485dde566c1a9 100644
735 +--- a/net/caif/caif_usb.c
736 ++++ b/net/caif/caif_usb.c
737 +@@ -116,6 +116,11 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
738 + return (struct cflayer *) this;
739 + }
740 +
741 ++static void cfusbl_release(struct cflayer *layer)
742 ++{
743 ++ kfree(layer);
744 ++}
745 ++
746 + static struct packet_type caif_usb_type __read_mostly = {
747 + .type = cpu_to_be16(ETH_P_802_EX1),
748 + };
749 +@@ -128,6 +133,7 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
750 + struct cflayer *layer, *link_support;
751 + struct usbnet *usbnet;
752 + struct usb_device *usbdev;
753 ++ int res;
754 +
755 + /* Check whether we have a NCM device, and find its VID/PID. */
756 + if (!(dev->dev.parent && dev->dev.parent->driver &&
757 +@@ -170,8 +176,11 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
758 + if (dev->num_tx_queues > 1)
759 + pr_warn("USB device uses more than one tx queue\n");
760 +
761 +- caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
762 ++ res = caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
763 + &layer, &caif_usb_type.func);
764 ++ if (res)
765 ++ goto err;
766 ++
767 + if (!pack_added)
768 + dev_add_pack(&caif_usb_type);
769 + pack_added = true;
770 +@@ -181,6 +190,9 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
771 + layer->name[sizeof(layer->name) - 1] = 0;
772 +
773 + return 0;
774 ++err:
775 ++ cfusbl_release(link_support);
776 ++ return res;
777 + }
778 +
779 + static struct notifier_block caif_device_notifier = {
780 +diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
781 +index fa39fc2987086..c45b531a6cd5c 100644
782 +--- a/net/caif/cfcnfg.c
783 ++++ b/net/caif/cfcnfg.c
784 +@@ -455,7 +455,7 @@ unlock:
785 + rcu_read_unlock();
786 + }
787 +
788 +-void
789 ++int
790 + cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
791 + struct net_device *dev, struct cflayer *phy_layer,
792 + enum cfcnfg_phy_preference pref,
793 +@@ -464,7 +464,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
794 + {
795 + struct cflayer *frml;
796 + struct cfcnfg_phyinfo *phyinfo = NULL;
797 +- int i;
798 ++ int i, res = 0;
799 + u8 phyid;
800 +
801 + mutex_lock(&cnfg->lock);
802 +@@ -478,12 +478,15 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
803 + goto got_phyid;
804 + }
805 + pr_warn("Too many CAIF Link Layers (max 6)\n");
806 ++ res = -EEXIST;
807 + goto out;
808 +
809 + got_phyid:
810 + phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC);
811 +- if (!phyinfo)
812 ++ if (!phyinfo) {
813 ++ res = -ENOMEM;
814 + goto out_err;
815 ++ }
816 +
817 + phy_layer->id = phyid;
818 + phyinfo->pref = pref;
819 +@@ -497,8 +500,10 @@ got_phyid:
820 +
821 + frml = cffrml_create(phyid, fcs);
822 +
823 +- if (!frml)
824 ++ if (!frml) {
825 ++ res = -ENOMEM;
826 + goto out_err;
827 ++ }
828 + phyinfo->frm_layer = frml;
829 + layer_set_up(frml, cnfg->mux);
830 +
831 +@@ -516,11 +521,12 @@ got_phyid:
832 + list_add_rcu(&phyinfo->node, &cnfg->phys);
833 + out:
834 + mutex_unlock(&cnfg->lock);
835 +- return;
836 ++ return res;
837 +
838 + out_err:
839 + kfree(phyinfo);
840 + mutex_unlock(&cnfg->lock);
841 ++ return res;
842 + }
843 + EXPORT_SYMBOL(cfcnfg_add_phy_layer);
844 +
845 +diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
846 +index ce60f06d76de3..af1e1e36dc90a 100644
847 +--- a/net/caif/cfserl.c
848 ++++ b/net/caif/cfserl.c
849 +@@ -31,6 +31,11 @@ static int cfserl_transmit(struct cflayer *layr, struct cfpkt *pkt);
850 + static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
851 + int phyid);
852 +
853 ++void cfserl_release(struct cflayer *layer)
854 ++{
855 ++ kfree(layer);
856 ++}
857 ++
858 + struct cflayer *cfserl_create(int instance, bool use_stx)
859 + {
860 + struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC);
861 +diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
862 +index c0930b9fe848b..7531cb1665d2b 100644
863 +--- a/net/ieee802154/nl-mac.c
864 ++++ b/net/ieee802154/nl-mac.c
865 +@@ -688,8 +688,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info)
866 + nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) ||
867 + nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER,
868 + be32_to_cpu(params.frame_counter)) ||
869 +- ieee802154_llsec_fill_key_id(msg, &params.out_key))
870 ++ ieee802154_llsec_fill_key_id(msg, &params.out_key)) {
871 ++ rc = -ENOBUFS;
872 + goto out_free;
873 ++ }
874 +
875 + dev_put(dev);
876 +
877 +diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
878 +index 77d73014bde31..11f53dc0c1c09 100644
879 +--- a/net/ieee802154/nl-phy.c
880 ++++ b/net/ieee802154/nl-phy.c
881 +@@ -249,8 +249,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
882 + }
883 +
884 + if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) ||
885 +- nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name))
886 ++ nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) {
887 ++ rc = -EMSGSIZE;
888 + goto nla_put_failure;
889 ++ }
890 + dev_put(dev);
891 +
892 + wpan_phy_put(phy);
893 +diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
894 +index ba9e711f7e3d6..4e08305a55c48 100644
895 +--- a/net/netfilter/ipvs/ip_vs_ctl.c
896 ++++ b/net/netfilter/ipvs/ip_vs_ctl.c
897 +@@ -1256,7 +1256,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,
898 + ip_vs_addr_copy(svc->af, &svc->addr, &u->addr);
899 + svc->port = u->port;
900 + svc->fwmark = u->fwmark;
901 +- svc->flags = u->flags;
902 ++ svc->flags = u->flags & ~IP_VS_SVC_F_HASHED;
903 + svc->timeout = u->timeout * HZ;
904 + svc->netmask = u->netmask;
905 + svc->ipvs = ipvs;
906 +diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
907 +index 8396dc8ee2474..babe42ff3eecf 100644
908 +--- a/net/netfilter/nfnetlink_cthelper.c
909 ++++ b/net/netfilter/nfnetlink_cthelper.c
910 +@@ -355,10 +355,14 @@ static int
911 + nfnl_cthelper_update(const struct nlattr * const tb[],
912 + struct nf_conntrack_helper *helper)
913 + {
914 ++ u32 size;
915 + int ret;
916 +
917 +- if (tb[NFCTH_PRIV_DATA_LEN])
918 +- return -EBUSY;
919 ++ if (tb[NFCTH_PRIV_DATA_LEN]) {
920 ++ size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN]));
921 ++ if (size != helper->data_len)
922 ++ return -EBUSY;
923 ++ }
924 +
925 + if (tb[NFCTH_POLICY]) {
926 + ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]);
927 +diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
928 +index 22e340a9049c8..92c6fbfd51f79 100644
929 +--- a/net/nfc/llcp_sock.c
930 ++++ b/net/nfc/llcp_sock.c
931 +@@ -121,6 +121,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
932 + if (!llcp_sock->service_name) {
933 + nfc_llcp_local_put(llcp_sock->local);
934 + llcp_sock->local = NULL;
935 ++ llcp_sock->dev = NULL;
936 + ret = -ENOMEM;
937 + goto put_dev;
938 + }
939 +@@ -130,6 +131,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
940 + llcp_sock->local = NULL;
941 + kfree(llcp_sock->service_name);
942 + llcp_sock->service_name = NULL;
943 ++ llcp_sock->dev = NULL;
944 + ret = -EADDRINUSE;
945 + goto put_dev;
946 + }
947 +diff --git a/sound/core/timer.c b/sound/core/timer.c
948 +index f8a4b2a2f8f6b..6475b85599364 100644
949 +--- a/sound/core/timer.c
950 ++++ b/sound/core/timer.c
951 +@@ -488,9 +488,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
952 + return;
953 + if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
954 + return;
955 ++ event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
956 + list_for_each_entry(ts, &ti->slave_active_head, active_list)
957 + if (ts->ccallback)
958 +- ts->ccallback(ts, event + 100, &tstamp, resolution);
959 ++ ts->ccallback(ts, event, &tstamp, resolution);
960 + }
961 +
962 + /* start/continue a master timer */