aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-08-02 12:05:13 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-08-07 06:56:01 +0000
commit02a182fc23f4769efbaa25d93b76d4ddc944f22b (patch)
tree019ddcf590be03d5220d09f668a01215912adb00
parenta28bace575d90d4480eb3d804ce109ea471ee7fa (diff)
downloadalpine_aports-02a182fc23f4769efbaa25d93b76d4ddc944f22b.tar.bz2
alpine_aports-02a182fc23f4769efbaa25d93b76d4ddc944f22b.tar.xz
alpine_aports-02a182fc23f4769efbaa25d93b76d4ddc944f22b.zip
main/linux-grsec: merge in stable fixes from 3.10.4 and 3.4.55
This brings the kernel up to 3.10.4/3.4.55 level (cherry picked from commit 8f793ce81852fd6a321f6f0d4d8c3c057a7901c1)
-rw-r--r--main/linux-grsec/APKBUILD10
-rw-r--r--main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-2.patch (renamed from main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-1.patch)1901
2 files changed, 1873 insertions, 38 deletions
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD
index 5dfc2d900e..fd772985c0 100644
--- a/main/linux-grsec/APKBUILD
+++ b/main/linux-grsec/APKBUILD
@@ -7,7 +7,7 @@ case $pkgver in
7*.*.*) _kernver=${pkgver%.*};; 7*.*.*) _kernver=${pkgver%.*};;
8*.*) _kernver=${pkgver};; 8*.*) _kernver=${pkgver};;
9esac 9esac
10pkgrel=1 10pkgrel=2
11pkgdesc="Linux kernel with grsecurity" 11pkgdesc="Linux kernel with grsecurity"
12url=http://grsecurity.net 12url=http://grsecurity.net
13depends="mkinitfs linux-firmware" 13depends="mkinitfs linux-firmware"
@@ -17,7 +17,7 @@ _config=${config:-kernelconfig.${CARCH}}
17install= 17install=
18source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz 18source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz
19 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz 19 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz
20 grsecurity-2.9.1-3.9.11-unofficial-1.patch 20 grsecurity-2.9.1-3.9.11-unofficial-2.patch
21 21
22 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 22 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
23 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 23 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
@@ -150,7 +150,7 @@ dev() {
150 150
151md5sums="4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz 151md5sums="4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz
152552146435b7ecc414bf8e3cd8bb6ac4a patch-3.9.11.xz 152552146435b7ecc414bf8e3cd8bb6ac4a patch-3.9.11.xz
1530888981bb55e0d27b6ed39edcc7ee45a grsecurity-2.9.1-3.9.11-unofficial-1.patch 153808e4e5dd176692d62ccfbf5988a88fa grsecurity-2.9.1-3.9.11-unofficial-2.patch
154a16f11b12381efb3bec79b9bfb329836 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 154a16f11b12381efb3bec79b9bfb329836 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
155656ae7b10dd2f18dbfa1011041d08d60 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 155656ae7b10dd2f18dbfa1011041d08d60 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
156aa454ffb96428586447775c21449e284 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 156aa454ffb96428586447775c21449e284 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
@@ -161,7 +161,7 @@ d89089b3c7eb94dd9f65cf8a357fc36d kernelconfig.x86
161eb147f09fef5996a488c247790205cd6 kernelconfig.x86_64" 161eb147f09fef5996a488c247790205cd6 kernelconfig.x86_64"
162sha256sums="60bc3e64ee5dc778de2cd7cd7640abf518a4c9d4f31b8ed624e16fad53f54541 linux-3.9.tar.xz 162sha256sums="60bc3e64ee5dc778de2cd7cd7640abf518a4c9d4f31b8ed624e16fad53f54541 linux-3.9.tar.xz
16329be11d16ef152ae1858d567cbf45f0da0193adf364826f5e3fa8b2fcd839682 patch-3.9.11.xz 16329be11d16ef152ae1858d567cbf45f0da0193adf364826f5e3fa8b2fcd839682 patch-3.9.11.xz
164fa2223e87b38e225568a36ee2eb00976f74bc109e2ccc21c93abed676f58e3ad grsecurity-2.9.1-3.9.11-unofficial-1.patch 164bd672d212020b5a7a00b3e0f6df39efbba6d0a1cbad88e0bf65cbaf8f8045204 grsecurity-2.9.1-3.9.11-unofficial-2.patch
1656af3757ac36a6cd3cda7b0a71b08143726383b19261294a569ad7f4042c72df3 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 1656af3757ac36a6cd3cda7b0a71b08143726383b19261294a569ad7f4042c72df3 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
166dc8e82108615657f1fb9d641efd42255a5761c06edde1b00a41ae0d314d548f0 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 166dc8e82108615657f1fb9d641efd42255a5761c06edde1b00a41ae0d314d548f0 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
1670985caa0f3ee8ed0959aeaa4214f5f8057ae8e61d50dcae39194912d31e14892 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 1670985caa0f3ee8ed0959aeaa4214f5f8057ae8e61d50dcae39194912d31e14892 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
@@ -172,7 +172,7 @@ de3c17420664ae4e52826c6e602aade0deeae94f72253f85b3e48771491ed5d6 kernelconfig.x
172e1cce320f207cc2ba72b9d154c7060c8cbed52c664319dfd21f24e8956d0bf3e kernelconfig.x86_64" 172e1cce320f207cc2ba72b9d154c7060c8cbed52c664319dfd21f24e8956d0bf3e kernelconfig.x86_64"
173sha512sums="77fa521f42380409f8ab400c26f7b00e225cb075ef40834bb263325cfdcc3e65aef8511ec2fc2b50bbf4f50e226fb5ab07d7a479aaf09162adbbf318325d0790 linux-3.9.tar.xz 173sha512sums="77fa521f42380409f8ab400c26f7b00e225cb075ef40834bb263325cfdcc3e65aef8511ec2fc2b50bbf4f50e226fb5ab07d7a479aaf09162adbbf318325d0790 linux-3.9.tar.xz
174c3a0be102d816ae06d7dfdd2738915fc2114cb9bb488b03b34e4f52f2367dcba4d8cb8ba203687bf694c2dcad36d70bb9d3121ac739a28e2c7fb2c44f08a9c71 patch-3.9.11.xz 174c3a0be102d816ae06d7dfdd2738915fc2114cb9bb488b03b34e4f52f2367dcba4d8cb8ba203687bf694c2dcad36d70bb9d3121ac739a28e2c7fb2c44f08a9c71 patch-3.9.11.xz
17559e34764fca125d097d1826042dce0e6fb0bf53eb97935b591e57674fb755491d78b1180a6db6253a869ffe56f7ceddf2e80f24812319e2b2f623d3e100aaa00 grsecurity-2.9.1-3.9.11-unofficial-1.patch 175730e24dffc70250945d873358a2fbe19f1c9249befeaba6e53ce8c1b4ebb19583d51d6a437b6d9a39b705f48001f4a645f92560ef6b4db88ee8fbf9f17bafd41 grsecurity-2.9.1-3.9.11-unofficial-2.patch
17681e78593288e8b0fd2c03ea9fc1450323887707f087e911f172450a122bc9b591ee83394836789730d951aeec13d0b75a64e1c05f04364abf8f80d883ddc4a02 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 17681e78593288e8b0fd2c03ea9fc1450323887707f087e911f172450a122bc9b591ee83394836789730d951aeec13d0b75a64e1c05f04364abf8f80d883ddc4a02 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
17751ecb15b669f6a82940a13a38939116e003bf5dfd24496771c8279e907b72adcc63d607f0340a2940d757e12ddadb7d45c7af78ae311d284935a6296dbcac00c 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 17751ecb15b669f6a82940a13a38939116e003bf5dfd24496771c8279e907b72adcc63d607f0340a2940d757e12ddadb7d45c7af78ae311d284935a6296dbcac00c 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
17857d0a8bd35d19cf657ded58efe24517d2252aec6984040713ba173a34edb5887ececaa2985076bc6a149eaa57639fd98a042c1c2d226ed4ad8dd5ed0e230717e 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 17857d0a8bd35d19cf657ded58efe24517d2252aec6984040713ba173a34edb5887ececaa2985076bc6a149eaa57639fd98a042c1c2d226ed4ad8dd5ed0e230717e 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
diff --git a/main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-1.patch b/main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-2.patch
index 932805c959..cb0d943df0 100644
--- a/main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-1.patch
+++ b/main/linux-grsec/grsecurity-2.9.1-3.9.11-unofficial-2.patch
@@ -34724,8 +34724,42 @@ index b70709b..1d8d02a 100644
34724 .notifier_call = sh_dmae_nmi_handler, 34724 .notifier_call = sh_dmae_nmi_handler,
34725 34725
34726 /* Run before NMI debug handler and KGDB */ 34726 /* Run before NMI debug handler and KGDB */
34727diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
34728index 27e86d9..89e1090 100644
34729--- a/drivers/edac/edac_mc.c
34730+++ b/drivers/edac/edac_mc.c
34731@@ -48,6 +48,8 @@ static LIST_HEAD(mc_devices);
34732 */
34733 static void const *edac_mc_owner;
34734
34735+static struct bus_type mc_bus[EDAC_MAX_MCS];
34736+
34737 unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
34738 unsigned len)
34739 {
34740@@ -723,6 +725,11 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
34741 int ret = -EINVAL;
34742 edac_dbg(0, "\n");
34743
34744+ if (mci->mc_idx >= EDAC_MAX_MCS) {
34745+ pr_warn_once("Too many memory controllers: %d\n", mci->mc_idx);
34746+ return -ENODEV;
34747+ }
34748+
34749 #ifdef CONFIG_EDAC_DEBUG
34750 if (edac_debug_level >= 3)
34751 edac_mc_dump_mci(mci);
34752@@ -762,6 +769,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
34753 /* set load time so that error rate can be tracked */
34754 mci->start_time = jiffies;
34755
34756+ mci->bus = &mc_bus[mci->mc_idx];
34757+
34758 if (edac_create_sysfs_mci_device(mci)) {
34759 edac_mc_printk(mci, KERN_WARNING,
34760 "failed to create sysfs device\n");
34727diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c 34761diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
34728index 769d92e..a3dcc1e 100644 34762index 769d92e..8baa11a 100644
34729--- a/drivers/edac/edac_mc_sysfs.c 34763--- a/drivers/edac/edac_mc_sysfs.c
34730+++ b/drivers/edac/edac_mc_sysfs.c 34764+++ b/drivers/edac/edac_mc_sysfs.c
34731@@ -148,7 +148,7 @@ static const char *edac_caps[] = { 34765@@ -148,7 +148,7 @@ static const char *edac_caps[] = {
@@ -34737,7 +34771,60 @@ index 769d92e..a3dcc1e 100644
34737 34771
34738 #define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \ 34772 #define DEVICE_CHANNEL(_name, _mode, _show, _store, _var) \
34739 struct dev_ch_attribute dev_attr_legacy_##_name = \ 34773 struct dev_ch_attribute dev_attr_legacy_##_name = \
34740@@ -1003,14 +1003,16 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) 34774@@ -370,7 +370,7 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
34775 return -ENODEV;
34776
34777 csrow->dev.type = &csrow_attr_type;
34778- csrow->dev.bus = &mci->bus;
34779+ csrow->dev.bus = mci->bus;
34780 device_initialize(&csrow->dev);
34781 csrow->dev.parent = &mci->dev;
34782 csrow->mci = mci;
34783@@ -605,7 +605,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci,
34784 dimm->mci = mci;
34785
34786 dimm->dev.type = &dimm_attr_type;
34787- dimm->dev.bus = &mci->bus;
34788+ dimm->dev.bus = mci->bus;
34789 device_initialize(&dimm->dev);
34790
34791 dimm->dev.parent = &mci->dev;
34792@@ -975,11 +975,13 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
34793 * The memory controller needs its own bus, in order to avoid
34794 * namespace conflicts at /sys/bus/edac.
34795 */
34796- mci->bus.name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
34797- if (!mci->bus.name)
34798+ mci->bus->name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
34799+ if (!mci->bus->name)
34800 return -ENOMEM;
34801- edac_dbg(0, "creating bus %s\n", mci->bus.name);
34802- err = bus_register(&mci->bus);
34803+
34804+ edac_dbg(0, "creating bus %s\n", mci->bus->name);
34805+
34806+ err = bus_register(mci->bus);
34807 if (err < 0)
34808 return err;
34809
34810@@ -988,7 +990,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
34811 device_initialize(&mci->dev);
34812
34813 mci->dev.parent = mci_pdev;
34814- mci->dev.bus = &mci->bus;
34815+ mci->dev.bus = mci->bus;
34816 dev_set_name(&mci->dev, "mc%d", mci->mc_idx);
34817 dev_set_drvdata(&mci->dev, mci);
34818 pm_runtime_forbid(&mci->dev);
34819@@ -997,20 +999,22 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
34820 err = device_add(&mci->dev);
34821 if (err < 0) {
34822 edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev));
34823- bus_unregister(&mci->bus);
34824- kfree(mci->bus.name);
34825+ bus_unregister(mci->bus);
34826+ kfree(mci->bus->name);
34827 return err;
34741 } 34828 }
34742 34829
34743 if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) { 34830 if (mci->set_sdram_scrub_rate || mci->get_sdram_scrub_rate) {
@@ -34758,6 +34845,28 @@ index 769d92e..a3dcc1e 100644
34758 err = device_create_file(&mci->dev, 34845 err = device_create_file(&mci->dev,
34759 &dev_attr_sdram_scrub_rate); 34846 &dev_attr_sdram_scrub_rate);
34760 if (err) { 34847 if (err) {
34848@@ -1064,8 +1068,8 @@ fail:
34849 }
34850 fail2:
34851 device_unregister(&mci->dev);
34852- bus_unregister(&mci->bus);
34853- kfree(mci->bus.name);
34854+ bus_unregister(mci->bus);
34855+ kfree(mci->bus->name);
34856 return err;
34857 }
34858
34859@@ -1098,8 +1102,8 @@ void edac_unregister_sysfs(struct mem_ctl_info *mci)
34860 {
34861 edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
34862 device_unregister(&mci->dev);
34863- bus_unregister(&mci->bus);
34864- kfree(mci->bus.name);
34865+ bus_unregister(mci->bus);
34866+ kfree(mci->bus->name);
34867 }
34868
34869 static void mc_attr_release(struct device *dev)
34761diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c 34870diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
34762index e8658e4..22746d6 100644 34871index e8658e4..22746d6 100644
34763--- a/drivers/edac/edac_pci_sysfs.c 34872--- a/drivers/edac/edac_pci_sysfs.c
@@ -34854,6 +34963,19 @@ index e8658e4..22746d6 100644
34854 panic("EDAC: PCI Parity Error"); 34963 panic("EDAC: PCI Parity Error");
34855 } 34964 }
34856 } 34965 }
34966diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
34967index 1b63517..157b934 100644
34968--- a/drivers/edac/i5100_edac.c
34969+++ b/drivers/edac/i5100_edac.c
34970@@ -974,7 +974,7 @@ static int i5100_setup_debugfs(struct mem_ctl_info *mci)
34971 if (!i5100_debugfs)
34972 return -ENODEV;
34973
34974- priv->debugfs = debugfs_create_dir(mci->bus.name, i5100_debugfs);
34975+ priv->debugfs = debugfs_create_dir(mci->bus->name, i5100_debugfs);
34976
34977 if (!priv->debugfs)
34978 return -ENOMEM;
34857diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h 34979diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
34858index 51b7e3a..aa8a3e8 100644 34980index 51b7e3a..aa8a3e8 100644
34859--- a/drivers/edac/mce_amd.h 34981--- a/drivers/edac/mce_amd.h
@@ -38670,6 +38792,20 @@ index bc78354..42c9459 100644
38670 38792
38671 module_param_array(video_nr, int, NULL, 0444); 38793 module_param_array(video_nr, int, NULL, 0444);
38672 module_param_array(vbi_nr, int, NULL, 0444); 38794 module_param_array(vbi_nr, int, NULL, 0444);
38795diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c
38796index 10460fd..dbcdfbf 100644
38797--- a/drivers/media/pci/saa7134/saa7134-alsa.c
38798+++ b/drivers/media/pci/saa7134/saa7134-alsa.c
38799@@ -172,7 +172,9 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev,
38800 dprintk("irq: overrun [full=%d/%d] - Blocks in %d\n",dev->dmasound.read_count,
38801 dev->dmasound.bufsize, dev->dmasound.blocks);
38802 spin_unlock(&dev->slock);
38803+ snd_pcm_stream_lock(dev->dmasound.substream);
38804 snd_pcm_stop(dev->dmasound.substream,SNDRV_PCM_STATE_XRUN);
38805+ snd_pcm_stream_unlock(dev->dmasound.substream);
38806 return;
38807 }
38808
38673diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c 38809diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
38674index 96c4a17..1305a79 100644 38810index 96c4a17..1305a79 100644
38675--- a/drivers/media/platform/omap/omap_vout.c 38811--- a/drivers/media/platform/omap/omap_vout.c
@@ -39835,6 +39971,28 @@ index dbbea0e..3f4a0b1 100644
39835 39971
39836 #ifdef CONFIG_NET_POLL_CONTROLLER 39972 #ifdef CONFIG_NET_POLL_CONTROLLER
39837 /* 39973 /*
39974diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
39975index 42aa54a..b710c6b 100644
39976--- a/drivers/net/dummy.c
39977+++ b/drivers/net/dummy.c
39978@@ -185,6 +185,8 @@ static int __init dummy_init_module(void)
39979
39980 rtnl_lock();
39981 err = __rtnl_link_register(&dummy_link_ops);
39982+ if (err < 0)
39983+ goto out;
39984
39985 for (i = 0; i < numdummies && !err; i++) {
39986 err = dummy_init_one();
39987@@ -192,6 +194,8 @@ static int __init dummy_init_module(void)
39988 }
39989 if (err < 0)
39990 __rtnl_link_unregister(&dummy_link_ops);
39991+
39992+out:
39993 rtnl_unlock();
39994
39995 return err;
39838diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c 39996diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
39839index e1d2643..7f4133b 100644 39997index e1d2643..7f4133b 100644
39840--- a/drivers/net/ethernet/8390/ax88796.c 39998--- a/drivers/net/ethernet/8390/ax88796.c
@@ -39852,6 +40010,112 @@ index e1d2643..7f4133b 100644
39852 } 40010 }
39853 40011
39854 if (!request_mem_region(mem->start, mem_size, pdev->name)) { 40012 if (!request_mem_region(mem->start, mem_size, pdev->name)) {
40013diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
40014index ac25f05..35c9d1a 100644
40015--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
40016+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
40017@@ -1667,8 +1667,8 @@ check_sum:
40018 return 0;
40019 }
40020
40021-static void atl1e_tx_map(struct atl1e_adapter *adapter,
40022- struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
40023+static int atl1e_tx_map(struct atl1e_adapter *adapter,
40024+ struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
40025 {
40026 struct atl1e_tpd_desc *use_tpd = NULL;
40027 struct atl1e_tx_buffer *tx_buffer = NULL;
40028@@ -1679,6 +1679,8 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
40029 u16 nr_frags;
40030 u16 f;
40031 int segment;
40032+ int ring_start = adapter->tx_ring.next_to_use;
40033+ int ring_end;
40034
40035 nr_frags = skb_shinfo(skb)->nr_frags;
40036 segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK;
40037@@ -1691,6 +1693,9 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
40038 tx_buffer->length = map_len;
40039 tx_buffer->dma = pci_map_single(adapter->pdev,
40040 skb->data, hdr_len, PCI_DMA_TODEVICE);
40041+ if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma))
40042+ return -ENOSPC;
40043+
40044 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
40045 mapped_len += map_len;
40046 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
40047@@ -1717,6 +1722,22 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
40048 tx_buffer->dma =
40049 pci_map_single(adapter->pdev, skb->data + mapped_len,
40050 map_len, PCI_DMA_TODEVICE);
40051+
40052+ if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
40053+ /* We need to unwind the mappings we've done */
40054+ ring_end = adapter->tx_ring.next_to_use;
40055+ adapter->tx_ring.next_to_use = ring_start;
40056+ while (adapter->tx_ring.next_to_use != ring_end) {
40057+ tpd = atl1e_get_tpd(adapter);
40058+ tx_buffer = atl1e_get_tx_buffer(adapter, tpd);
40059+ pci_unmap_single(adapter->pdev, tx_buffer->dma,
40060+ tx_buffer->length, PCI_DMA_TODEVICE);
40061+ }
40062+ /* Reset the tx rings next pointer */
40063+ adapter->tx_ring.next_to_use = ring_start;
40064+ return -ENOSPC;
40065+ }
40066+
40067 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
40068 mapped_len += map_len;
40069 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
40070@@ -1752,6 +1773,23 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
40071 (i * MAX_TX_BUF_LEN),
40072 tx_buffer->length,
40073 DMA_TO_DEVICE);
40074+
40075+ if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
40076+ /* We need to unwind the mappings we've done */
40077+ ring_end = adapter->tx_ring.next_to_use;
40078+ adapter->tx_ring.next_to_use = ring_start;
40079+ while (adapter->tx_ring.next_to_use != ring_end) {
40080+ tpd = atl1e_get_tpd(adapter);
40081+ tx_buffer = atl1e_get_tx_buffer(adapter, tpd);
40082+ dma_unmap_page(&adapter->pdev->dev, tx_buffer->dma,
40083+ tx_buffer->length, DMA_TO_DEVICE);
40084+ }
40085+
40086+ /* Reset the ring next to use pointer */
40087+ adapter->tx_ring.next_to_use = ring_start;
40088+ return -ENOSPC;
40089+ }
40090+
40091 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE);
40092 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
40093 use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) |
40094@@ -1769,6 +1807,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
40095 /* The last buffer info contain the skb address,
40096 so it will be free after unmap */
40097 tx_buffer->skb = skb;
40098+ return 0;
40099 }
40100
40101 static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count,
40102@@ -1836,10 +1875,15 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
40103 return NETDEV_TX_OK;
40104 }
40105
40106- atl1e_tx_map(adapter, skb, tpd);
40107+ if (atl1e_tx_map(adapter, skb, tpd)) {
40108+ dev_kfree_skb_any(skb);
40109+ goto out;
40110+ }
40111+
40112 atl1e_tx_queue(adapter, tpd_req, tpd);
40113
40114 netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
40115+out:
40116 spin_unlock_irqrestore(&adapter->tx_lock, flags);
40117 return NETDEV_TX_OK;
40118 }
39855diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h 40119diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
39856index aee7671..3ca2651 100644 40120index aee7671..3ca2651 100644
39857--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h 40121--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -40166,6 +40430,61 @@ index 54fd2ef..33c8a4f 100644
40166 40430
40167 int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv); 40431 int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv);
40168 int (*get_settings)(struct net_device *, struct ethtool_cmd *); 40432 int (*get_settings)(struct net_device *, struct ethtool_cmd *);
40433diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
40434index 8791999..68caa85 100644
40435--- a/drivers/net/ethernet/renesas/sh_eth.c
40436+++ b/drivers/net/ethernet/renesas/sh_eth.c
40437@@ -172,8 +172,9 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
40438 .rmcr_value = 0x00000001,
40439
40440 .tx_check = EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO,
40441- .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE |
40442- EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,
40443+ .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE |
40444+ EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE |
40445+ EESR_ECI,
40446 .tx_error_check = EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE,
40447
40448 .apr = 1,
40449@@ -286,9 +287,9 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data_giga = {
40450 .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
40451
40452 .tx_check = EESR_TC1 | EESR_FTC,
40453- .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | \
40454- EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | \
40455- EESR_ECI,
40456+ .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
40457+ EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
40458+ EESR_TDE | EESR_ECI,
40459 .tx_error_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_TDE | \
40460 EESR_TFE,
40461 .fdr_value = 0x0000072f,
40462@@ -505,9 +506,9 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
40463 .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
40464
40465 .tx_check = EESR_TC1 | EESR_FTC,
40466- .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | \
40467- EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | \
40468- EESR_ECI,
40469+ .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
40470+ EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
40471+ EESR_TDE | EESR_ECI,
40472 .tx_error_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_TDE | \
40473 EESR_TFE,
40474
40475diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
40476index 828be45..832be11 100644
40477--- a/drivers/net/ethernet/renesas/sh_eth.h
40478+++ b/drivers/net/ethernet/renesas/sh_eth.h
40479@@ -472,7 +472,7 @@ enum EESR_BIT {
40480
40481 #define DEFAULT_TX_CHECK (EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | \
40482 EESR_RTO)
40483-#define DEFAULT_EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | \
40484+#define DEFAULT_EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | \
40485 EESR_RDE | EESR_RFRMER | EESR_ADE | \
40486 EESR_TFE | EESR_TDE | EESR_ECI)
40487 #define DEFAULT_TX_ERROR_CHECK (EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | \
40169diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c 40488diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
40170index 3f93624..cf01144 100644 40489index 3f93624..cf01144 100644
40171--- a/drivers/net/ethernet/sfc/ptp.c 40490--- a/drivers/net/ethernet/sfc/ptp.c
@@ -40194,6 +40513,19 @@ index 50617c5..b13724c 100644
40194 } 40513 }
40195 40514
40196 /* To mask all all interrupts.*/ 40515 /* To mask all all interrupts.*/
40516diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
40517index 1df0ff3..3df5684 100644
40518--- a/drivers/net/ethernet/sun/sunvnet.c
40519+++ b/drivers/net/ethernet/sun/sunvnet.c
40520@@ -1239,6 +1239,8 @@ static int vnet_port_remove(struct vio_dev *vdev)
40521 dev_set_drvdata(&vdev->dev, NULL);
40522
40523 kfree(port);
40524+
40525+ unregister_netdev(vp->dev);
40526 }
40527 return 0;
40528 }
40197diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h 40529diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
40198index e6fe0d8..2b7d752 100644 40530index e6fe0d8..2b7d752 100644
40199--- a/drivers/net/hyperv/hyperv_net.h 40531--- a/drivers/net/hyperv/hyperv_net.h
@@ -40242,6 +40574,29 @@ index 8f1c256..a2991d1 100644
40242 40574
40243 priv = netdev_priv(dev); 40575 priv = netdev_priv(dev);
40244 priv->phy = phy; 40576 priv->phy = phy;
40577diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
40578index 8216438..c51944d 100644
40579--- a/drivers/net/ifb.c
40580+++ b/drivers/net/ifb.c
40581@@ -290,11 +290,17 @@ static int __init ifb_init_module(void)
40582
40583 rtnl_lock();
40584 err = __rtnl_link_register(&ifb_link_ops);
40585+ if (err < 0)
40586+ goto out;
40587
40588- for (i = 0; i < numifbs && !err; i++)
40589+ for (i = 0; i < numifbs && !err; i++) {
40590 err = ifb_init_one(i);
40591+ cond_resched();
40592+ }
40593 if (err)
40594 __rtnl_link_unregister(&ifb_link_ops);
40595+
40596+out:
40597 rtnl_unlock();
40598
40599 return err;
40245diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c 40600diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
40246index 011062e..ada88e9 100644 40601index 011062e..ada88e9 100644
40247--- a/drivers/net/macvlan.c 40602--- a/drivers/net/macvlan.c
@@ -40279,7 +40634,7 @@ index 011062e..ada88e9 100644
40279 }; 40634 };
40280 40635
40281diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c 40636diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
40282index acf6450..8f771b7 100644 40637index acf6450..d880503 100644
40283--- a/drivers/net/macvtap.c 40638--- a/drivers/net/macvtap.c
40284+++ b/drivers/net/macvtap.c 40639+++ b/drivers/net/macvtap.c
40285@@ -525,8 +525,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, 40640@@ -525,8 +525,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
@@ -40295,7 +40650,105 @@ index acf6450..8f771b7 100644
40295 return -EFAULT; 40650 return -EFAULT;
40296 } 40651 }
40297 truesize = size * PAGE_SIZE; 40652 truesize = size * PAGE_SIZE;
40298@@ -1099,7 +1101,7 @@ static int macvtap_device_event(struct notifier_block *unused, 40653@@ -632,6 +634,28 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
40654 return 0;
40655 }
40656
40657+static unsigned long iov_pages(const struct iovec *iv, int offset,
40658+ unsigned long nr_segs)
40659+{
40660+ unsigned long seg, base;
40661+ int pages = 0, len, size;
40662+
40663+ while (nr_segs && (offset >= iv->iov_len)) {
40664+ offset -= iv->iov_len;
40665+ ++iv;
40666+ --nr_segs;
40667+ }
40668+
40669+ for (seg = 0; seg < nr_segs; seg++) {
40670+ base = (unsigned long)iv[seg].iov_base + offset;
40671+ len = iv[seg].iov_len - offset;
40672+ size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT;
40673+ pages += size;
40674+ offset = 0;
40675+ }
40676+
40677+ return pages;
40678+}
40679
40680 /* Get packet from user space buffer */
40681 static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
40682@@ -647,6 +671,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
40683 int copylen = 0;
40684 bool zerocopy = false;
40685 struct flow_keys keys;
40686+ size_t linear;
40687
40688 if (q->flags & IFF_VNET_HDR) {
40689 vnet_hdr_len = q->vnet_hdr_sz;
40690@@ -678,42 +703,35 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
40691 if (unlikely(count > UIO_MAXIOV))
40692 goto err;
40693
40694- if (m && m->msg_control && sock_flag(&q->sk, SOCK_ZEROCOPY))
40695- zerocopy = true;
40696+ if (m && m->msg_control && sock_flag(&q->sk, SOCK_ZEROCOPY)) {
40697+ copylen = vnet_hdr.hdr_len ? vnet_hdr.hdr_len : GOODCOPY_LEN;
40698+ linear = copylen;
40699+ if (iov_pages(iv, vnet_hdr_len + copylen, count)
40700+ <= MAX_SKB_FRAGS)
40701+ zerocopy = true;
40702+ }
40703
40704- if (zerocopy) {
40705- /* Userspace may produce vectors with count greater than
40706- * MAX_SKB_FRAGS, so we need to linearize parts of the skb
40707- * to let the rest of data to be fit in the frags.
40708- */
40709- if (count > MAX_SKB_FRAGS) {
40710- copylen = iov_length(iv, count - MAX_SKB_FRAGS);
40711- if (copylen < vnet_hdr_len)
40712- copylen = 0;
40713- else
40714- copylen -= vnet_hdr_len;
40715- }
40716- /* There are 256 bytes to be copied in skb, so there is enough
40717- * room for skb expand head in case it is used.
40718- * The rest buffer is mapped from userspace.
40719- */
40720- if (copylen < vnet_hdr.hdr_len)
40721- copylen = vnet_hdr.hdr_len;
40722- if (!copylen)
40723- copylen = GOODCOPY_LEN;
40724- } else
40725+ if (!zerocopy) {
40726 copylen = len;
40727+ linear = vnet_hdr.hdr_len;
40728+ }
40729
40730 skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen,
40731- vnet_hdr.hdr_len, noblock, &err);
40732+ linear, noblock, &err);
40733 if (!skb)
40734 goto err;
40735
40736 if (zerocopy)
40737 err = zerocopy_sg_from_iovec(skb, iv, vnet_hdr_len, count);
40738- else
40739+ else {
40740 err = skb_copy_datagram_from_iovec(skb, 0, iv, vnet_hdr_len,
40741 len);
40742+ if (!err && m && m->msg_control) {
40743+ struct ubuf_info *uarg = m->msg_control;
40744+ uarg->callback(uarg, false);
40745+ }
40746+ }
40747+
40748 if (err)
40749 goto err_kfree;
40750
40751@@ -1099,7 +1117,7 @@ static int macvtap_device_event(struct notifier_block *unused,
40299 return NOTIFY_DONE; 40752 return NOTIFY_DONE;
40300 } 40753 }
40301 40754
@@ -40365,7 +40818,7 @@ index 0017b67..ab8f595 100644
40365 }; 40818 };
40366 40819
40367diff --git a/drivers/net/tun.c b/drivers/net/tun.c 40820diff --git a/drivers/net/tun.c b/drivers/net/tun.c
40368index 8ad822e..eb895f1 100644 40821index 8ad822e..9bf0655 100644
40369--- a/drivers/net/tun.c 40822--- a/drivers/net/tun.c
40370+++ b/drivers/net/tun.c 40823+++ b/drivers/net/tun.c
40371@@ -1013,8 +1013,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from, 40824@@ -1013,8 +1013,10 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
@@ -40381,7 +40834,109 @@ index 8ad822e..eb895f1 100644
40381 return -EFAULT; 40834 return -EFAULT;
40382 } 40835 }
40383 truesize = size * PAGE_SIZE; 40836 truesize = size * PAGE_SIZE;
40384@@ -1859,7 +1861,7 @@ unlock: 40837@@ -1038,6 +1040,29 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
40838 return 0;
40839 }
40840
40841+static unsigned long iov_pages(const struct iovec *iv, int offset,
40842+ unsigned long nr_segs)
40843+{
40844+ unsigned long seg, base;
40845+ int pages = 0, len, size;
40846+
40847+ while (nr_segs && (offset >= iv->iov_len)) {
40848+ offset -= iv->iov_len;
40849+ ++iv;
40850+ --nr_segs;
40851+ }
40852+
40853+ for (seg = 0; seg < nr_segs; seg++) {
40854+ base = (unsigned long)iv[seg].iov_base + offset;
40855+ len = iv[seg].iov_len - offset;
40856+ size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT;
40857+ pages += size;
40858+ offset = 0;
40859+ }
40860+
40861+ return pages;
40862+}
40863+
40864 /* Get packet from user space buffer */
40865 static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
40866 void *msg_control, const struct iovec *iv,
40867@@ -1045,7 +1070,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
40868 {
40869 struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
40870 struct sk_buff *skb;
40871- size_t len = total_len, align = NET_SKB_PAD;
40872+ size_t len = total_len, align = NET_SKB_PAD, linear;
40873 struct virtio_net_hdr gso = { 0 };
40874 int offset = 0;
40875 int copylen;
40876@@ -1086,34 +1111,23 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
40877 return -EINVAL;
40878 }
40879
40880- if (msg_control)
40881- zerocopy = true;
40882-
40883- if (zerocopy) {
40884- /* Userspace may produce vectors with count greater than
40885- * MAX_SKB_FRAGS, so we need to linearize parts of the skb
40886- * to let the rest of data to be fit in the frags.
40887- */
40888- if (count > MAX_SKB_FRAGS) {
40889- copylen = iov_length(iv, count - MAX_SKB_FRAGS);
40890- if (copylen < offset)
40891- copylen = 0;
40892- else
40893- copylen -= offset;
40894- } else
40895- copylen = 0;
40896- /* There are 256 bytes to be copied in skb, so there is enough
40897- * room for skb expand head in case it is used.
40898+ if (msg_control) {
40899+ /* There are 256 bytes to be copied in skb, so there is
40900+ * enough room for skb expand head in case it is used.
40901 * The rest of the buffer is mapped from userspace.
40902 */
40903- if (copylen < gso.hdr_len)
40904- copylen = gso.hdr_len;
40905- if (!copylen)
40906- copylen = GOODCOPY_LEN;
40907- } else
40908+ copylen = gso.hdr_len ? gso.hdr_len : GOODCOPY_LEN;
40909+ linear = copylen;
40910+ if (iov_pages(iv, offset + copylen, count) <= MAX_SKB_FRAGS)
40911+ zerocopy = true;
40912+ }
40913+
40914+ if (!zerocopy) {
40915 copylen = len;
40916+ linear = gso.hdr_len;
40917+ }
40918
40919- skb = tun_alloc_skb(tfile, align, copylen, gso.hdr_len, noblock);
40920+ skb = tun_alloc_skb(tfile, align, copylen, linear, noblock);
40921 if (IS_ERR(skb)) {
40922 if (PTR_ERR(skb) != -EAGAIN)
40923 tun->dev->stats.rx_dropped++;
40924@@ -1122,8 +1136,13 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
40925
40926 if (zerocopy)
40927 err = zerocopy_sg_from_iovec(skb, iv, offset, count);
40928- else
40929+ else {
40930 err = skb_copy_datagram_from_iovec(skb, 0, iv, offset, len);
40931+ if (!err && msg_control) {
40932+ struct ubuf_info *uarg = msg_control;
40933+ uarg->callback(uarg, false);
40934+ }
40935+ }
40936
40937 if (err) {
40938 tun->dev->stats.rx_dropped++;
40939@@ -1859,7 +1878,7 @@ unlock:
40385 } 40940 }
40386 40941
40387 static long __tun_chr_ioctl(struct file *file, unsigned int cmd, 40942 static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
@@ -40390,7 +40945,7 @@ index 8ad822e..eb895f1 100644
40390 { 40945 {
40391 struct tun_file *tfile = file->private_data; 40946 struct tun_file *tfile = file->private_data;
40392 struct tun_struct *tun; 40947 struct tun_struct *tun;
40393@@ -1871,6 +1873,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, 40948@@ -1871,6 +1890,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
40394 int vnet_hdr_sz; 40949 int vnet_hdr_sz;
40395 int ret; 40950 int ret;
40396 40951
@@ -42566,6 +43121,131 @@ index 98af07c..7625fb5 100644
42566 } 43121 }
42567 43122
42568 /** 43123 /**
43124diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
43125index 9d53540..e5a5746 100644
43126--- a/drivers/scsi/megaraid/megaraid_sas_base.c
43127+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
43128@@ -4852,10 +4852,12 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
43129 sense, sense_handle);
43130 }
43131
43132- for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) {
43133- dma_free_coherent(&instance->pdev->dev,
43134- kern_sge32[i].length,
43135- kbuff_arr[i], kern_sge32[i].phys_addr);
43136+ for (i = 0; i < ioc->sge_count; i++) {
43137+ if (kbuff_arr[i])
43138+ dma_free_coherent(&instance->pdev->dev,
43139+ kern_sge32[i].length,
43140+ kbuff_arr[i],
43141+ kern_sge32[i].phys_addr);
43142 }
43143
43144 megasas_return_cmd(instance, cmd);
43145diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
43146index dcbf7c8..f8c4b85 100644
43147--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
43148+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
43149@@ -1273,6 +1273,7 @@ _scsih_slave_alloc(struct scsi_device *sdev)
43150 struct MPT3SAS_DEVICE *sas_device_priv_data;
43151 struct scsi_target *starget;
43152 struct _raid_device *raid_device;
43153+ struct _sas_device *sas_device;
43154 unsigned long flags;
43155
43156 sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
43157@@ -1301,6 +1302,19 @@ _scsih_slave_alloc(struct scsi_device *sdev)
43158 spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
43159 }
43160
43161+ if (!(sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME)) {
43162+ spin_lock_irqsave(&ioc->sas_device_lock, flags);
43163+ sas_device = mpt3sas_scsih_sas_device_find_by_sas_address(ioc,
43164+ sas_target_priv_data->sas_address);
43165+ if (sas_device && (sas_device->starget == NULL)) {
43166+ sdev_printk(KERN_INFO, sdev,
43167+ "%s : sas_device->starget set to starget @ %d\n",
43168+ __func__, __LINE__);
43169+ sas_device->starget = starget;
43170+ }
43171+ spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
43172+ }
43173+
43174 return 0;
43175 }
43176
43177@@ -6392,7 +6406,7 @@ _scsih_search_responding_sas_devices(struct MPT3SAS_ADAPTER *ioc)
43178 handle))) {
43179 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43180 MPI2_IOCSTATUS_MASK;
43181- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43182+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
43183 break;
43184 handle = le16_to_cpu(sas_device_pg0.DevHandle);
43185 device_info = le32_to_cpu(sas_device_pg0.DeviceInfo);
43186@@ -6494,7 +6508,7 @@ _scsih_search_responding_raid_devices(struct MPT3SAS_ADAPTER *ioc)
43187 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
43188 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43189 MPI2_IOCSTATUS_MASK;
43190- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43191+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
43192 break;
43193 handle = le16_to_cpu(volume_pg1.DevHandle);
43194
43195@@ -6518,7 +6532,7 @@ _scsih_search_responding_raid_devices(struct MPT3SAS_ADAPTER *ioc)
43196 phys_disk_num))) {
43197 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43198 MPI2_IOCSTATUS_MASK;
43199- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43200+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
43201 break;
43202 phys_disk_num = pd_pg0.PhysDiskNum;
43203 handle = le16_to_cpu(pd_pg0.DevHandle);
43204@@ -6597,7 +6611,7 @@ _scsih_search_responding_expanders(struct MPT3SAS_ADAPTER *ioc)
43205
43206 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43207 MPI2_IOCSTATUS_MASK;
43208- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43209+ if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
43210 break;
43211
43212 handle = le16_to_cpu(expander_pg0.DevHandle);
43213@@ -6742,8 +6756,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
43214 MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) {
43215 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43216 MPI2_IOCSTATUS_MASK;
43217- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43218- break;
43219 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
43220 pr_info(MPT3SAS_FMT "\tbreak from expander scan: " \
43221 "ioc_status(0x%04x), loginfo(0x%08x)\n",
43222@@ -6787,8 +6799,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
43223 phys_disk_num))) {
43224 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43225 MPI2_IOCSTATUS_MASK;
43226- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43227- break;
43228 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
43229 pr_info(MPT3SAS_FMT "\tbreak from phys disk scan: "\
43230 "ioc_status(0x%04x), loginfo(0x%08x)\n",
43231@@ -6854,8 +6864,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
43232 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
43233 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43234 MPI2_IOCSTATUS_MASK;
43235- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43236- break;
43237 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
43238 pr_info(MPT3SAS_FMT "\tbreak from volume scan: " \
43239 "ioc_status(0x%04x), loginfo(0x%08x)\n",
43240@@ -6914,8 +6922,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
43241 handle))) {
43242 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
43243 MPI2_IOCSTATUS_MASK;
43244- if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
43245- break;
43246 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
43247 pr_info(MPT3SAS_FMT "\tbreak from end device scan:"\
43248 " ioc_status(0x%04x), loginfo(0x%08x)\n",
42569diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c 43249diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
42570index b46f5e9..c4c4ccb 100644 43250index b46f5e9..c4c4ccb 100644
42571--- a/drivers/scsi/pmcraid.c 43251--- a/drivers/scsi/pmcraid.c
@@ -44852,6 +45532,119 @@ index 5f3bcd3..bfca43f 100644
44852 usb_autopm_put_interface(serial->interface); 45532 usb_autopm_put_interface(serial->interface);
44853 error_get_interface: 45533 error_get_interface:
44854 usb_serial_put(serial); 45534 usb_serial_put(serial);
45535diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
45536index 4747d1c..3850e92 100644
45537--- a/drivers/usb/serial/cp210x.c
45538+++ b/drivers/usb/serial/cp210x.c
45539@@ -53,6 +53,7 @@ static const struct usb_device_id id_table[] = {
45540 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
45541 { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
45542 { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
45543+ { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */
45544 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
45545 { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
45546 { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
45547@@ -118,6 +119,8 @@ static const struct usb_device_id id_table[] = {
45548 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
45549 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
45550 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
45551+ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
45552+ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
45553 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
45554 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
45555 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
45556@@ -148,6 +151,7 @@ static const struct usb_device_id id_table[] = {
45557 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
45558 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
45559 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
45560+ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
45561 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
45562 { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
45563 { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */
45564diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
45565index 9162db2..b7cabbf 100644
45566--- a/drivers/usb/serial/option.c
45567+++ b/drivers/usb/serial/option.c
45568@@ -343,17 +343,12 @@ static void option_instat_callback(struct urb *urb);
45569 #define OLIVETTI_VENDOR_ID 0x0b3c
45570 #define OLIVETTI_PRODUCT_OLICARD100 0xc000
45571 #define OLIVETTI_PRODUCT_OLICARD145 0xc003
45572+#define OLIVETTI_PRODUCT_OLICARD200 0xc005
45573
45574 /* Celot products */
45575 #define CELOT_VENDOR_ID 0x211f
45576 #define CELOT_PRODUCT_CT680M 0x6801
45577
45578-/* ONDA Communication vendor id */
45579-#define ONDA_VENDOR_ID 0x1ee8
45580-
45581-/* ONDA MT825UP HSDPA 14.2 modem */
45582-#define ONDA_MT825UP 0x000b
45583-
45584 /* Samsung products */
45585 #define SAMSUNG_VENDOR_ID 0x04e8
45586 #define SAMSUNG_PRODUCT_GT_B3730 0x6889
45587@@ -446,7 +441,8 @@ static void option_instat_callback(struct urb *urb);
45588
45589 /* Hyundai Petatel Inc. products */
45590 #define PETATEL_VENDOR_ID 0x1ff4
45591-#define PETATEL_PRODUCT_NP10T 0x600e
45592+#define PETATEL_PRODUCT_NP10T_600A 0x600a
45593+#define PETATEL_PRODUCT_NP10T_600E 0x600e
45594
45595 /* TP-LINK Incorporated products */
45596 #define TPLINK_VENDOR_ID 0x2357
45597@@ -786,6 +782,7 @@ static const struct usb_device_id option_ids[] = {
45598 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) },
45599 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
45600 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
45601+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
45602 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
45603 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */
45604 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) },
45605@@ -821,7 +818,8 @@ static const struct usb_device_id option_ids[] = {
45606 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff),
45607 .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
45608 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) },
45609- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) },
45610+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff),
45611+ .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
45612 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) },
45613 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff),
45614 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
45615@@ -1260,8 +1258,8 @@ static const struct usb_device_id option_ids[] = {
45616
45617 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
45618 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) },
45619+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) },
45620 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
45621- { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */
45622 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
45623 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
45624 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM610) },
45625@@ -1333,9 +1331,12 @@ static const struct usb_device_id option_ids[] = {
45626 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
45627 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
45628 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
45629- { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
45630+ { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
45631+ { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
45632 { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
45633 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
45634+ { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */
45635+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
45636 { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) },
45637 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x02, 0x01) }, /* D-Link DWM-156 (variant) */
45638 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d01, 0xff, 0x00, 0x00) }, /* D-Link DWM-156 (variant) */
45639@@ -1343,6 +1344,8 @@ static const struct usb_device_id option_ids[] = {
45640 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) },
45641 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) },
45642 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
45643+ { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
45644+ { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
45645 { } /* Terminating entry */
45646 };
45647 MODULE_DEVICE_TABLE(usb, option_ids);
44855diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c 45648diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
44856index 6c3586a..a94e621 100644 45649index 6c3586a..a94e621 100644
44857--- a/drivers/usb/storage/realtek_cr.c 45650--- a/drivers/usb/storage/realtek_cr.c
@@ -49532,10 +50325,36 @@ index b96fc6c..431d628 100644
49532 __bio_for_each_segment(bvec, bio, i, 0) { 50325 __bio_for_each_segment(bvec, bio, i, 0) {
49533 char *addr = page_address(bvec->bv_page); 50326 char *addr = page_address(bvec->bv_page);
49534diff --git a/fs/block_dev.c b/fs/block_dev.c 50327diff --git a/fs/block_dev.c b/fs/block_dev.c
49535index aae187a..fd790ba 100644 50328index aae187a..8325c5d 100644
49536--- a/fs/block_dev.c 50329--- a/fs/block_dev.c
49537+++ b/fs/block_dev.c 50330+++ b/fs/block_dev.c
49538@@ -652,7 +652,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole, 50331@@ -57,17 +57,24 @@ static void bdev_inode_switch_bdi(struct inode *inode,
50332 struct backing_dev_info *dst)
50333 {
50334 struct backing_dev_info *old = inode->i_data.backing_dev_info;
50335+ bool wakeup_bdi = false;
50336
50337 if (unlikely(dst == old)) /* deadlock avoidance */
50338 return;
50339 bdi_lock_two(&old->wb, &dst->wb);
50340 spin_lock(&inode->i_lock);
50341 inode->i_data.backing_dev_info = dst;
50342- if (inode->i_state & I_DIRTY)
50343+ if (inode->i_state & I_DIRTY) {
50344+ if (bdi_cap_writeback_dirty(dst) && !wb_has_dirty_io(&dst->wb))
50345+ wakeup_bdi = true;
50346 list_move(&inode->i_wb_list, &dst->wb.b_dirty);
50347+ }
50348 spin_unlock(&inode->i_lock);
50349 spin_unlock(&old->wb.list_lock);
50350 spin_unlock(&dst->wb.list_lock);
50351+
50352+ if (wakeup_bdi)
50353+ bdi_wakeup_thread_delayed(dst);
50354 }
50355
50356 /* Kill _all_ buffers and pagecache , dirty or not.. */
50357@@ -652,7 +659,7 @@ static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
49539 else if (bdev->bd_contains == bdev) 50358 else if (bdev->bd_contains == bdev)
49540 return true; /* is a whole device which isn't held */ 50359 return true; /* is a whole device which isn't held */
49541 50360
@@ -51470,6 +52289,20 @@ index 22548f5..41521d8 100644
51470 return 0; 52289 return 0;
51471 } 52290 }
51472 return 1; 52291 return 1;
52292diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
52293index d512c4b..d706dbf 100644
52294--- a/fs/ext3/inode.c
52295+++ b/fs/ext3/inode.c
52296@@ -218,7 +218,8 @@ void ext3_evict_inode (struct inode *inode)
52297 */
52298 if (inode->i_nlink && ext3_should_journal_data(inode) &&
52299 EXT3_SB(inode->i_sb)->s_journal &&
52300- (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode))) {
52301+ (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode)) &&
52302+ inode->i_ino != EXT3_JOURNAL_INO) {
52303 tid_t commit_tid = atomic_read(&ei->i_datasync_tid);
52304 journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
52305
51473diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c 52306diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
51474index 92e68b3..115d987 100644 52307index 92e68b3..115d987 100644
51475--- a/fs/ext4/balloc.c 52308--- a/fs/ext4/balloc.c
@@ -53387,10 +54220,76 @@ index 11dfa0c..6f64416 100644
53387 if (!ret) 54220 if (!ret)
53388 ret = -EPIPE; 54221 ret = -EPIPE;
53389diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c 54222diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
53390index 185c479..51b9986 100644 54223index 185c479..2a4c1b2 100644
53391--- a/fs/fuse/dir.c 54224--- a/fs/fuse/dir.c
53392+++ b/fs/fuse/dir.c 54225+++ b/fs/fuse/dir.c
53393@@ -1415,7 +1415,7 @@ static char *read_link(struct dentry *dentry) 54226@@ -1225,13 +1225,29 @@ static int fuse_direntplus_link(struct file *file,
54227 if (name.name[1] == '.' && name.len == 2)
54228 return 0;
54229 }
54230+
54231+ if (invalid_nodeid(o->nodeid))
54232+ return -EIO;
54233+ if (!fuse_valid_type(o->attr.mode))
54234+ return -EIO;
54235+
54236 fc = get_fuse_conn(dir);
54237
54238 name.hash = full_name_hash(name.name, name.len);
54239 dentry = d_lookup(parent, &name);
54240- if (dentry && dentry->d_inode) {
54241+ if (dentry) {
54242 inode = dentry->d_inode;
54243- if (get_node_id(inode) == o->nodeid) {
54244+ if (!inode) {
54245+ d_drop(dentry);
54246+ } else if (get_node_id(inode) != o->nodeid ||
54247+ ((o->attr.mode ^ inode->i_mode) & S_IFMT)) {
54248+ err = d_invalidate(dentry);
54249+ if (err)
54250+ goto out;
54251+ } else if (is_bad_inode(inode)) {
54252+ err = -EIO;
54253+ goto out;
54254+ } else {
54255 struct fuse_inode *fi;
54256 fi = get_fuse_inode(inode);
54257 spin_lock(&fc->lock);
54258@@ -1244,9 +1260,6 @@ static int fuse_direntplus_link(struct file *file,
54259 */
54260 goto found;
54261 }
54262- err = d_invalidate(dentry);
54263- if (err)
54264- goto out;
54265 dput(dentry);
54266 dentry = NULL;
54267 }
54268@@ -1261,10 +1274,19 @@ static int fuse_direntplus_link(struct file *file,
54269 if (!inode)
54270 goto out;
54271
54272- alias = d_materialise_unique(dentry, inode);
54273- err = PTR_ERR(alias);
54274- if (IS_ERR(alias))
54275- goto out;
54276+ if (S_ISDIR(inode->i_mode)) {
54277+ mutex_lock(&fc->inst_mutex);
54278+ alias = fuse_d_add_directory(dentry, inode);
54279+ mutex_unlock(&fc->inst_mutex);
54280+ err = PTR_ERR(alias);
54281+ if (IS_ERR(alias)) {
54282+ iput(inode);
54283+ goto out;
54284+ }
54285+ } else {
54286+ alias = d_splice_alias(inode, dentry);
54287+ }
54288+
54289 if (alias) {
54290 dput(dentry);
54291 dentry = alias;
54292@@ -1415,7 +1437,7 @@ static char *read_link(struct dentry *dentry)
53394 return link; 54293 return link;
53395 } 54294 }
53396 54295
@@ -53577,6 +54476,36 @@ index a2aa97d..10d6c41 100644
53577 if (IS_ERR(nlmsvc_task)) { 54476 if (IS_ERR(nlmsvc_task)) {
53578 error = PTR_ERR(nlmsvc_task); 54477 error = PTR_ERR(nlmsvc_task);
53579 printk(KERN_WARNING 54478 printk(KERN_WARNING
54479diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
54480index e703318..8ebd3f5 100644
54481--- a/fs/lockd/svclock.c
54482+++ b/fs/lockd/svclock.c
54483@@ -939,6 +939,7 @@ nlmsvc_retry_blocked(void)
54484 unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
54485 struct nlm_block *block;
54486
54487+ spin_lock(&nlm_blocked_lock);
54488 while (!list_empty(&nlm_blocked) && !kthread_should_stop()) {
54489 block = list_entry(nlm_blocked.next, struct nlm_block, b_list);
54490
54491@@ -948,6 +949,7 @@ nlmsvc_retry_blocked(void)
54492 timeout = block->b_when - jiffies;
54493 break;
54494 }
54495+ spin_unlock(&nlm_blocked_lock);
54496
54497 dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",
54498 block, block->b_when);
54499@@ -957,7 +959,9 @@ nlmsvc_retry_blocked(void)
54500 retry_deferred_block(block);
54501 } else
54502 nlmsvc_grant_blocked(block);
54503+ spin_lock(&nlm_blocked_lock);
54504 }
54505+ spin_unlock(&nlm_blocked_lock);
54506
54507 return timeout;
54508 }
53580diff --git a/fs/locks.c b/fs/locks.c 54509diff --git a/fs/locks.c b/fs/locks.c
53581index cb424a4..850e4dd 100644 54510index cb424a4..850e4dd 100644
53582--- a/fs/locks.c 54511--- a/fs/locks.c
@@ -56773,6 +57702,63 @@ index 04ce1ac..a13dd1e 100644
56773 57702
56774 generic_fillattr(inode, stat); 57703 generic_fillattr(inode, stat);
56775 return 0; 57704 return 0;
57705diff --git a/fs/super.c b/fs/super.c
57706index 7465d43..68307c0 100644
57707--- a/fs/super.c
57708+++ b/fs/super.c
57709@@ -336,19 +336,19 @@ EXPORT_SYMBOL(deactivate_super);
57710 * and want to turn it into a full-blown active reference. grab_super()
57711 * is called with sb_lock held and drops it. Returns 1 in case of
57712 * success, 0 if we had failed (superblock contents was already dead or
57713- * dying when grab_super() had been called).
57714+ * dying when grab_super() had been called). Note that this is only
57715+ * called for superblocks not in rundown mode (== ones still on ->fs_supers
57716+ * of their type), so increment of ->s_count is OK here.
57717 */
57718 static int grab_super(struct super_block *s) __releases(sb_lock)
57719 {
57720- if (atomic_inc_not_zero(&s->s_active)) {
57721- spin_unlock(&sb_lock);
57722- return 1;
57723- }
57724- /* it's going away */
57725 s->s_count++;
57726 spin_unlock(&sb_lock);
57727- /* wait for it to die */
57728 down_write(&s->s_umount);
57729+ if ((s->s_flags & MS_BORN) && atomic_inc_not_zero(&s->s_active)) {
57730+ put_super(s);
57731+ return 1;
57732+ }
57733 up_write(&s->s_umount);
57734 put_super(s);
57735 return 0;
57736@@ -463,11 +463,6 @@ retry:
57737 destroy_super(s);
57738 s = NULL;
57739 }
57740- down_write(&old->s_umount);
57741- if (unlikely(!(old->s_flags & MS_BORN))) {
57742- deactivate_locked_super(old);
57743- goto retry;
57744- }
57745 return old;
57746 }
57747 }
57748@@ -660,10 +655,10 @@ restart:
57749 if (hlist_unhashed(&sb->s_instances))
57750 continue;
57751 if (sb->s_bdev == bdev) {
57752- if (grab_super(sb)) /* drops sb_lock */
57753- return sb;
57754- else
57755+ if (!grab_super(sb))
57756 goto restart;
57757+ up_write(&sb->s_umount);
57758+ return sb;
57759 }
57760 }
57761 spin_unlock(&sb_lock);
56776diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c 57762diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
56777index 15c68f9..36a8b3e 100644 57763index 15c68f9..36a8b3e 100644
56778--- a/fs/sysfs/bin.c 57764--- a/fs/sysfs/bin.c
@@ -68485,6 +69471,29 @@ index 91ac8da..a841318 100644
68485 struct dma_pinned_list *pinned_list, struct page *page, 69471 struct dma_pinned_list *pinned_list, struct page *page,
68486 unsigned int offset, size_t len); 69472 unsigned int offset, size_t len);
68487 69473
69474diff --git a/include/linux/edac.h b/include/linux/edac.h
69475index 0b76327..5c6d7fb 100644
69476--- a/include/linux/edac.h
69477+++ b/include/linux/edac.h
69478@@ -622,7 +622,7 @@ struct edac_raw_error_desc {
69479 */
69480 struct mem_ctl_info {
69481 struct device dev;
69482- struct bus_type bus;
69483+ struct bus_type *bus;
69484
69485 struct list_head link; /* for global list of mem_ctl_info structs */
69486
69487@@ -742,4 +742,9 @@ struct mem_ctl_info {
69488 #endif
69489 };
69490
69491+/*
69492+ * Maximum number of memory controllers in the coherent fabric.
69493+ */
69494+#define EDAC_MAX_MCS 16
69495+
69496 #endif
68488diff --git a/include/linux/efi.h b/include/linux/efi.h 69497diff --git a/include/linux/efi.h b/include/linux/efi.h
68489index 3d7df3d..301f024 100644 69498index 3d7df3d..301f024 100644
68490--- a/include/linux/efi.h 69499--- a/include/linux/efi.h
@@ -69983,6 +70992,21 @@ index aff7ad8..3942bbd 100644
69983 70992
69984 extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); 70993 extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
69985 extern void unregister_pppox_proto(int proto_num); 70994 extern void unregister_pppox_proto(int proto_num);
70995diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
70996index 218a3b6..ee586cb 100644
70997--- a/include/linux/if_vlan.h
70998+++ b/include/linux/if_vlan.h
70999@@ -79,9 +79,8 @@ static inline int is_vlan_dev(struct net_device *dev)
71000 }
71001
71002 #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
71003-#define vlan_tx_nonzero_tag_present(__skb) \
71004- (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK))
71005 #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
71006+#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK)
71007
71008 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
71009
69986diff --git a/include/linux/init.h b/include/linux/init.h 71010diff --git a/include/linux/init.h b/include/linux/init.h
69987index 8618147..0821126 100644 71011index 8618147..0821126 100644
69988--- a/include/linux/init.h 71012--- a/include/linux/init.h
@@ -72878,6 +73902,20 @@ index adcbb20..62c2559 100644
72878 73902
72879 void v9fs_register_trans(struct p9_trans_module *m); 73903 void v9fs_register_trans(struct p9_trans_module *m);
72880 void v9fs_unregister_trans(struct p9_trans_module *m); 73904 void v9fs_unregister_trans(struct p9_trans_module *m);
73905diff --git a/include/net/addrconf.h b/include/net/addrconf.h
73906index 84a6440..dbc6db7 100644
73907--- a/include/net/addrconf.h
73908+++ b/include/net/addrconf.h
73909@@ -86,6 +86,9 @@ extern int ipv6_dev_get_saddr(struct net *net,
73910 const struct in6_addr *daddr,
73911 unsigned int srcprefs,
73912 struct in6_addr *saddr);
73913+extern int __ipv6_get_lladdr(struct inet6_dev *idev,
73914+ struct in6_addr *addr,
73915+ unsigned char banned_flags);
73916 extern int ipv6_get_lladdr(struct net_device *dev,
73917 struct in6_addr *addr,
73918 unsigned char banned_flags);
72881diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h 73919diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
72882index cdd3302..76f8ede 100644 73920index cdd3302..76f8ede 100644
72883--- a/include/net/bluetooth/l2cap.h 73921--- a/include/net/bluetooth/l2cap.h
@@ -73847,6 +74885,24 @@ index 8072d35..e77aeb8 100644
73847 #define ELFMAG0 0x7f /* EI_MAG */ 74885 #define ELFMAG0 0x7f /* EI_MAG */
73848 #define ELFMAG1 'E' 74886 #define ELFMAG1 'E'
73849 #define ELFMAG2 'L' 74887 #define ELFMAG2 'L'
74888diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
74889index 0b46fd5..e36a4ae 100644
74890--- a/include/uapi/linux/if_pppox.h
74891+++ b/include/uapi/linux/if_pppox.h
74892@@ -135,11 +135,11 @@ struct pppoe_tag {
74893
74894 struct pppoe_hdr {
74895 #if defined(__LITTLE_ENDIAN_BITFIELD)
74896- __u8 ver : 4;
74897 __u8 type : 4;
74898+ __u8 ver : 4;
74899 #elif defined(__BIG_ENDIAN_BITFIELD)
74900- __u8 type : 4;
74901 __u8 ver : 4;
74902+ __u8 type : 4;
74903 #else
74904 #error "Please fix <asm/byteorder.h>"
74905 #endif
73850diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h 74906diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h
73851index aa169c4..6a2771d 100644 74907index aa169c4..6a2771d 100644
73852--- a/include/uapi/linux/personality.h 74908--- a/include/uapi/linux/personality.h
@@ -75990,19 +77046,67 @@ index 9b22d03..6295b62 100644
75990 prev->next = info->next; 77046 prev->next = info->next;
75991 else 77047 else
75992diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c 77048diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
75993index 7ef5556..8247f11 100644 77049index 7ef5556..f67a983 100644
75994--- a/kernel/hrtimer.c 77050--- a/kernel/hrtimer.c
75995+++ b/kernel/hrtimer.c 77051+++ b/kernel/hrtimer.c
75996@@ -1416,7 +1416,7 @@ void hrtimer_peek_ahead_timers(void) 77052@@ -709,17 +709,20 @@ static int hrtimer_switch_to_hres(void)
77053 return 1;
77054 }
77055
77056+static void clock_was_set_work(struct work_struct *work)
77057+{
77058+ clock_was_set();
77059+}
77060+
77061+static DECLARE_WORK(hrtimer_work, clock_was_set_work);
77062+
77063 /*
77064- * Called from timekeeping code to reprogramm the hrtimer interrupt
77065- * device. If called from the timer interrupt context we defer it to
77066- * softirq context.
77067+ * Called from timekeeping and resume code to reprogramm the hrtimer
77068+ * interrupt device on all cpus.
77069 */
77070 void clock_was_set_delayed(void)
77071 {
77072- struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
77073-
77074- cpu_base->clock_was_set = 1;
77075- __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
77076+ schedule_work(&hrtimer_work);
77077 }
77078
77079 #else
77080@@ -768,8 +771,10 @@ void hrtimers_resume(void)
77081 WARN_ONCE(!irqs_disabled(),
77082 KERN_INFO "hrtimers_resume() called with IRQs enabled!");
77083
77084+ /* Retrigger on the local CPU */
77085 retrigger_next_event(NULL);
77086- timerfd_clock_was_set();
77087+ /* And schedule a retrigger for all others */
77088+ clock_was_set_delayed();
77089 }
77090
77091 static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
77092@@ -1416,15 +1421,8 @@ void hrtimer_peek_ahead_timers(void)
75997 local_irq_restore(flags); 77093 local_irq_restore(flags);
75998 } 77094 }
75999 77095
76000-static void run_hrtimer_softirq(struct softirq_action *h) 77096-static void run_hrtimer_softirq(struct softirq_action *h)
76001+static void run_hrtimer_softirq(void) 77097+static void run_hrtimer_softirq(void)
76002 { 77098 {
76003 struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); 77099- struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
77100-
77101- if (cpu_base->clock_was_set) {
77102- cpu_base->clock_was_set = 0;
77103- clock_was_set();
77104- }
77105-
77106 hrtimer_peek_ahead_timers();
77107 }
76004 77108
76005@@ -1758,7 +1758,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self, 77109@@ -1758,7 +1756,7 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
76006 return NOTIFY_OK; 77110 return NOTIFY_OK;
76007 } 77111 }
76008 77112
@@ -77662,6 +78766,20 @@ index 6edbb2c..334f085 100644
77662 return kc->clock_set(which_clock, &new_tp); 78766 return kc->clock_set(which_clock, &new_tp);
77663 } 78767 }
77664 78768
78769diff --git a/kernel/power/autosleep.c b/kernel/power/autosleep.c
78770index c6422ff..9012ecf 100644
78771--- a/kernel/power/autosleep.c
78772+++ b/kernel/power/autosleep.c
78773@@ -32,7 +32,8 @@ static void try_to_suspend(struct work_struct *work)
78774
78775 mutex_lock(&autosleep_lock);
78776
78777- if (!pm_save_wakeup_count(initial_count)) {
78778+ if (!pm_save_wakeup_count(initial_count) ||
78779+ system_state != SYSTEM_RUNNING) {
78780 mutex_unlock(&autosleep_lock);
78781 goto out;
78782 }
77665diff --git a/kernel/power/process.c b/kernel/power/process.c 78783diff --git a/kernel/power/process.c b/kernel/power/process.c
77666index 98088e0..aaf95c0 100644 78784index 98088e0..aaf95c0 100644
77667--- a/kernel/power/process.c 78785--- a/kernel/power/process.c
@@ -80174,10 +81292,27 @@ index 6989df2..c2265cf 100644
80174 *data_page = bpage; 81292 *data_page = bpage;
80175 81293
80176diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c 81294diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
80177index 3f28192..a29e8b0 100644 81295index 3f28192..9afb0a9 100644
80178--- a/kernel/trace/trace.c 81296--- a/kernel/trace/trace.c
80179+++ b/kernel/trace/trace.c 81297+++ b/kernel/trace/trace.c
80180@@ -2893,7 +2893,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set) 81298@@ -683,7 +683,15 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
81299
81300 memcpy(max_data->comm, tsk->comm, TASK_COMM_LEN);
81301 max_data->pid = tsk->pid;
81302- max_data->uid = task_uid(tsk);
81303+ /*
81304+ * If tsk == current, then use current_uid(), as that does not use
81305+ * RCU. The irq tracer can be called out of RCU scope.
81306+ */
81307+ if (tsk == current)
81308+ max_data->uid = current_uid();
81309+ else
81310+ max_data->uid = task_uid(tsk);
81311+
81312 max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
81313 max_data->policy = tsk->policy;
81314 max_data->rt_priority = tsk->rt_priority;
81315@@ -2893,7 +2901,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set)
80181 return 0; 81316 return 0;
80182 } 81317 }
80183 81318
@@ -80186,7 +81321,7 @@ index 3f28192..a29e8b0 100644
80186 { 81321 {
80187 /* do nothing if flag is already set */ 81322 /* do nothing if flag is already set */
80188 if (!!(trace_flags & mask) == !!enabled) 81323 if (!!(trace_flags & mask) == !!enabled)
80189@@ -4637,10 +4637,9 @@ static const struct file_operations tracing_dyn_info_fops = { 81324@@ -4637,10 +4645,9 @@ static const struct file_operations tracing_dyn_info_fops = {
80190 }; 81325 };
80191 #endif 81326 #endif
80192 81327
@@ -80198,7 +81333,7 @@ index 3f28192..a29e8b0 100644
80198 static int once; 81333 static int once;
80199 81334
80200 if (d_tracer) 81335 if (d_tracer)
80201@@ -4660,10 +4659,9 @@ struct dentry *tracing_init_dentry(void) 81336@@ -4660,10 +4667,9 @@ struct dentry *tracing_init_dentry(void)
80202 return d_tracer; 81337 return d_tracer;
80203 } 81338 }
80204 81339
@@ -85781,6 +86916,44 @@ index 85addcd..c429a13 100644
85781 struct vlan_net *vn; 86916 struct vlan_net *vn;
85782 86917
85783 vn = net_generic(net, vlan_net_id); 86918 vn = net_generic(net, vlan_net_id);
86919diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
86920index f3b6f51..6c205fc 100644
86921--- a/net/8021q/vlan_core.c
86922+++ b/net/8021q/vlan_core.c
86923@@ -8,7 +8,7 @@
86924 bool vlan_do_receive(struct sk_buff **skbp)
86925 {
86926 struct sk_buff *skb = *skbp;
86927- u16 vlan_id = skb->vlan_tci & VLAN_VID_MASK;
86928+ u16 vlan_id = vlan_tx_tag_get_id(skb);
86929 struct net_device *vlan_dev;
86930 struct vlan_pcpu_stats *rx_stats;
86931
86932diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
86933index 63bd98c..c09b2b0 100644
86934--- a/net/8021q/vlan_dev.c
86935+++ b/net/8021q/vlan_dev.c
86936@@ -73,6 +73,8 @@ vlan_dev_get_egress_qos_mask(struct net_device *dev, struct sk_buff *skb)
86937 {
86938 struct vlan_priority_tci_mapping *mp;
86939
86940+ smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */
86941+
86942 mp = vlan_dev_priv(dev)->egress_priority_map[(skb->priority & 0xF)];
86943 while (mp) {
86944 if (mp->priority == skb->priority) {
86945@@ -248,6 +250,11 @@ int vlan_dev_set_egress_priority(const struct net_device *dev,
86946 np->next = mp;
86947 np->priority = skb_prio;
86948 np->vlan_qos = vlan_qos;
86949+ /* Before inserting this element in hash table, make sure all its fields
86950+ * are committed to memory.
86951+ * coupled with smp_rmb() in vlan_dev_get_egress_qos_mask()
86952+ */
86953+ smp_wmb();
86954 vlan->egress_priority_map[skb_prio & 0xF] = np;
86955 if (vlan_qos)
86956 vlan->nr_egress_mappings++;
85784diff --git a/net/9p/mod.c b/net/9p/mod.c 86957diff --git a/net/9p/mod.c b/net/9p/mod.c
85785index 6ab36ae..6f1841b 100644 86958index 6ab36ae..6f1841b 100644
85786--- a/net/9p/mod.c 86959--- a/net/9p/mod.c
@@ -85803,6 +86976,27 @@ index 6ab36ae..6f1841b 100644
85803 spin_unlock(&v9fs_trans_lock); 86976 spin_unlock(&v9fs_trans_lock);
85804 } 86977 }
85805 EXPORT_SYMBOL(v9fs_unregister_trans); 86978 EXPORT_SYMBOL(v9fs_unregister_trans);
86979diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c
86980index de8df95..2ee3879 100644
86981--- a/net/9p/trans_common.c
86982+++ b/net/9p/trans_common.c
86983@@ -24,11 +24,11 @@
86984 */
86985 void p9_release_pages(struct page **pages, int nr_pages)
86986 {
86987- int i = 0;
86988- while (pages[i] && nr_pages--) {
86989- put_page(pages[i]);
86990- i++;
86991- }
86992+ int i;
86993+
86994+ for (i = 0; i < nr_pages; i++)
86995+ if (pages[i])
86996+ put_page(pages[i]);
86997 }
86998 EXPORT_SYMBOL(p9_release_pages);
86999
85806diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c 87000diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
85807index 02efb25..41541a9 100644 87001index 02efb25..41541a9 100644
85808--- a/net/9p/trans_fd.c 87002--- a/net/9p/trans_fd.c
@@ -86210,6 +87404,22 @@ index b6e44ad..5b0d514 100644
86210 spin_unlock_irqrestore(&dev->port.lock, flags); 87404 spin_unlock_irqrestore(&dev->port.lock, flags);
86211 if (dev->tty_dev->parent) 87405 if (dev->tty_dev->parent)
86212 device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); 87406 device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST);
87407diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
87408index 923fbea..642566d 100644
87409--- a/net/bridge/br_multicast.c
87410+++ b/net/bridge/br_multicast.c
87411@@ -465,8 +465,9 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br,
87412 skb_set_transport_header(skb, skb->len);
87413 mldq = (struct mld_msg *) icmp6_hdr(skb);
87414
87415- interval = ipv6_addr_any(group) ? br->multicast_last_member_interval :
87416- br->multicast_query_response_interval;
87417+ interval = ipv6_addr_any(group) ?
87418+ br->multicast_query_response_interval :
87419+ br->multicast_last_member_interval;
87420
87421 mldq->mld_type = ICMPV6_MGM_QUERY;
87422 mldq->mld_code = 0;
86213diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c 87423diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
86214index 8d493c9..3849e49 100644 87424index 8d493c9..3849e49 100644
86215--- a/net/bridge/netfilter/ebtables.c 87425--- a/net/bridge/netfilter/ebtables.c
@@ -86482,7 +87692,7 @@ index 368f9c3..f82d4a3 100644
86482 87692
86483 return err; 87693 return err;
86484diff --git a/net/core/dev.c b/net/core/dev.c 87694diff --git a/net/core/dev.c b/net/core/dev.c
86485index c9eb9e6..922c789 100644 87695index c9eb9e6..9186a82 100644
86486--- a/net/core/dev.c 87696--- a/net/core/dev.c
86487+++ b/net/core/dev.c 87697+++ b/net/core/dev.c
86488@@ -1617,7 +1617,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) 87698@@ -1617,7 +1617,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
@@ -86530,7 +87740,25 @@ index c9eb9e6..922c789 100644
86530 { 87740 {
86531 struct softnet_data *sd = &__get_cpu_var(softnet_data); 87741 struct softnet_data *sd = &__get_cpu_var(softnet_data);
86532 87742
86533@@ -3496,7 +3496,7 @@ ncls: 87743@@ -3471,8 +3471,15 @@ ncls:
87744 }
87745 }
87746
87747- if (vlan_tx_nonzero_tag_present(skb))
87748- skb->pkt_type = PACKET_OTHERHOST;
87749+ if (unlikely(vlan_tx_tag_present(skb))) {
87750+ if (vlan_tx_tag_get_id(skb))
87751+ skb->pkt_type = PACKET_OTHERHOST;
87752+ /* Note: we might in the future use prio bits
87753+ * and set skb->priority like in vlan_do_receive()
87754+ * For the time being, just ignore Priority Code Point
87755+ */
87756+ skb->vlan_tci = 0;
87757+ }
87758
87759 /* deliver only exact match when indicated */
87760 null_or_dev = deliver_exact ? skb->dev : NULL;
87761@@ -3496,7 +3503,7 @@ ncls:
86534 ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); 87762 ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
86535 } else { 87763 } else {
86536 drop: 87764 drop:
@@ -86539,7 +87767,7 @@ index c9eb9e6..922c789 100644
86539 kfree_skb(skb); 87767 kfree_skb(skb);
86540 /* Jamal, now you will not able to escape explaining 87768 /* Jamal, now you will not able to escape explaining
86541 * me how you were going to use this. :-) 87769 * me how you were going to use this. :-)
86542@@ -4101,7 +4101,7 @@ void netif_napi_del(struct napi_struct *napi) 87770@@ -4101,7 +4108,7 @@ void netif_napi_del(struct napi_struct *napi)
86543 } 87771 }
86544 EXPORT_SYMBOL(netif_napi_del); 87772 EXPORT_SYMBOL(netif_napi_del);
86545 87773
@@ -86548,7 +87776,7 @@ index c9eb9e6..922c789 100644
86548 { 87776 {
86549 struct softnet_data *sd = &__get_cpu_var(softnet_data); 87777 struct softnet_data *sd = &__get_cpu_var(softnet_data);
86550 unsigned long time_limit = jiffies + 2; 87778 unsigned long time_limit = jiffies + 2;
86551@@ -5528,7 +5528,7 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 87779@@ -5528,7 +5535,7 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
86552 } else { 87780 } else {
86553 netdev_stats_to_stats64(storage, &dev->stats); 87781 netdev_stats_to_stats64(storage, &dev->stats);
86554 } 87782 }
@@ -86680,10 +87908,57 @@ index 7e7aeb0..2a998cb 100644
86680 87908
86681 m->msg_iov = iov; 87909 m->msg_iov = iov;
86682diff --git a/net/core/neighbour.c b/net/core/neighbour.c 87910diff --git a/net/core/neighbour.c b/net/core/neighbour.c
86683index 3863b8f..85c99a6 100644 87911index 3863b8f..7c7ea84 100644
86684--- a/net/core/neighbour.c 87912--- a/net/core/neighbour.c
86685+++ b/net/core/neighbour.c 87913+++ b/net/core/neighbour.c
86686@@ -2778,7 +2778,7 @@ static int proc_unres_qlen(ctl_table *ctl, int write, void __user *buffer, 87914@@ -239,7 +239,7 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev)
87915 we must kill timers etc. and move
87916 it to safe state.
87917 */
87918- skb_queue_purge(&n->arp_queue);
87919+ __skb_queue_purge(&n->arp_queue);
87920 n->arp_queue_len_bytes = 0;
87921 n->output = neigh_blackhole;
87922 if (n->nud_state & NUD_VALID)
87923@@ -294,7 +294,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl, struct net_device
87924 if (!n)
87925 goto out_entries;
87926
87927- skb_queue_head_init(&n->arp_queue);
87928+ __skb_queue_head_init(&n->arp_queue);
87929 rwlock_init(&n->lock);
87930 seqlock_init(&n->ha_lock);
87931 n->updated = n->used = now;
87932@@ -716,7 +716,9 @@ void neigh_destroy(struct neighbour *neigh)
87933 if (neigh_del_timer(neigh))
87934 pr_warn("Impossible event\n");
87935
87936- skb_queue_purge(&neigh->arp_queue);
87937+ write_lock_bh(&neigh->lock);
87938+ __skb_queue_purge(&neigh->arp_queue);
87939+ write_unlock_bh(&neigh->lock);
87940 neigh->arp_queue_len_bytes = 0;
87941
87942 if (dev->netdev_ops->ndo_neigh_destroy)
87943@@ -866,7 +868,7 @@ static void neigh_invalidate(struct neighbour *neigh)
87944 neigh->ops->error_report(neigh, skb);
87945 write_lock(&neigh->lock);
87946 }
87947- skb_queue_purge(&neigh->arp_queue);
87948+ __skb_queue_purge(&neigh->arp_queue);
87949 neigh->arp_queue_len_bytes = 0;
87950 }
87951
87952@@ -1218,7 +1220,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
87953
87954 write_lock_bh(&neigh->lock);
87955 }
87956- skb_queue_purge(&neigh->arp_queue);
87957+ __skb_queue_purge(&neigh->arp_queue);
87958 neigh->arp_queue_len_bytes = 0;
87959 }
87960 out:
87961@@ -2778,7 +2780,7 @@ static int proc_unres_qlen(ctl_table *ctl, int write, void __user *buffer,
86687 size_t *lenp, loff_t *ppos) 87962 size_t *lenp, loff_t *ppos)
86688 { 87963 {
86689 int size, ret; 87964 int size, ret;
@@ -87420,6 +88695,31 @@ index c7e8c04..56cb4c1 100644
87420 .kind = "gretap", 88695 .kind = "gretap",
87421 .maxtype = IFLA_GRE_MAX, 88696 .maxtype = IFLA_GRE_MAX,
87422 .policy = ipgre_policy, 88697 .policy = ipgre_policy,
88698diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
88699index 2bdf802..439f123 100644
88700--- a/net/ipv4/ip_input.c
88701+++ b/net/ipv4/ip_input.c
88702@@ -190,10 +190,7 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
88703 {
88704 struct net *net = dev_net(skb->dev);
88705
88706- __skb_pull(skb, ip_hdrlen(skb));
88707-
88708- /* Point into the IP datagram, just past the header. */
88709- skb_reset_transport_header(skb);
88710+ __skb_pull(skb, skb_network_header_len(skb));
88711
88712 rcu_read_lock();
88713 {
88714@@ -437,6 +434,8 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
88715 goto drop;
88716 }
88717
88718+ skb->transport_header = skb->network_header + iph->ihl*4;
88719+
88720 /* Remove any debris in the socket control block */
88721 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
88722
87423diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c 88723diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
87424index d9c4f11..02b82dbc 100644 88724index d9c4f11..02b82dbc 100644
87425--- a/net/ipv4/ip_sockglue.c 88725--- a/net/ipv4/ip_sockglue.c
@@ -87960,7 +89260,7 @@ index 59163c8..8277c51 100644
87960 if (icsk->icsk_af_ops->conn_request(sk, skb) < 0) 89260 if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
87961 return 1; 89261 return 1;
87962diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c 89262diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
87963index d09203c..fd5cc91 100644 89263index d09203c..518eff5 100644
87964--- a/net/ipv4/tcp_ipv4.c 89264--- a/net/ipv4/tcp_ipv4.c
87965+++ b/net/ipv4/tcp_ipv4.c 89265+++ b/net/ipv4/tcp_ipv4.c
87966@@ -90,6 +90,10 @@ int sysctl_tcp_low_latency __read_mostly; 89266@@ -90,6 +90,10 @@ int sysctl_tcp_low_latency __read_mostly;
@@ -87974,6 +89274,24 @@ index d09203c..fd5cc91 100644
87974 #ifdef CONFIG_TCP_MD5SIG 89274 #ifdef CONFIG_TCP_MD5SIG
87975 static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key, 89275 static int tcp_v4_md5_hash_hdr(char *md5_hash, const struct tcp_md5sig_key *key,
87976 __be32 daddr, __be32 saddr, const struct tcphdr *th); 89276 __be32 daddr, __be32 saddr, const struct tcphdr *th);
89277@@ -1005,7 +1009,7 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
89278 struct tcp_sock *tp = tcp_sk(sk);
89279 struct tcp_md5sig_info *md5sig;
89280
89281- key = tcp_md5_do_lookup(sk, (union tcp_md5_addr *)&addr, AF_INET);
89282+ key = tcp_md5_do_lookup(sk, addr, family);
89283 if (key) {
89284 /* Pre-existing entry - just update that one. */
89285 memcpy(key->key, newkey, newkeylen);
89286@@ -1050,7 +1054,7 @@ int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, int family)
89287 struct tcp_md5sig_key *key;
89288 struct tcp_md5sig_info *md5sig;
89289
89290- key = tcp_md5_do_lookup(sk, (union tcp_md5_addr *)&addr, AF_INET);
89291+ key = tcp_md5_do_lookup(sk, addr, family);
89292 if (!key)
89293 return -ENOENT;
89294 hlist_del_rcu(&key->node);
87977@@ -1897,6 +1901,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) 89295@@ -1897,6 +1901,9 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
87978 return 0; 89296 return 0;
87979 89297
@@ -88262,10 +89580,53 @@ index 9a459be..086b866 100644
88262 return -ENOMEM; 89580 return -ENOMEM;
88263 } 89581 }
88264diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c 89582diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
88265index 50a4c7c..50a27e6 100644 89583index 50a4c7c..231de25 100644
88266--- a/net/ipv6/addrconf.c 89584--- a/net/ipv6/addrconf.c
88267+++ b/net/ipv6/addrconf.c 89585+++ b/net/ipv6/addrconf.c
88268@@ -2274,7 +2274,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) 89586@@ -1375,6 +1375,23 @@ try_nextdev:
89587 }
89588 EXPORT_SYMBOL(ipv6_dev_get_saddr);
89589
89590+int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
89591+ unsigned char banned_flags)
89592+{
89593+ struct inet6_ifaddr *ifp;
89594+ int err = -EADDRNOTAVAIL;
89595+
89596+ list_for_each_entry(ifp, &idev->addr_list, if_list) {
89597+ if (ifp->scope == IFA_LINK &&
89598+ !(ifp->flags & banned_flags)) {
89599+ *addr = ifp->addr;
89600+ err = 0;
89601+ break;
89602+ }
89603+ }
89604+ return err;
89605+}
89606+
89607 int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
89608 unsigned char banned_flags)
89609 {
89610@@ -1384,17 +1401,8 @@ int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
89611 rcu_read_lock();
89612 idev = __in6_dev_get(dev);
89613 if (idev) {
89614- struct inet6_ifaddr *ifp;
89615-
89616 read_lock_bh(&idev->lock);
89617- list_for_each_entry(ifp, &idev->addr_list, if_list) {
89618- if (ifp->scope == IFA_LINK &&
89619- !(ifp->flags & banned_flags)) {
89620- *addr = ifp->addr;
89621- err = 0;
89622- break;
89623- }
89624- }
89625+ err = __ipv6_get_lladdr(idev, addr, banned_flags);
89626 read_unlock_bh(&idev->lock);
89627 }
89628 rcu_read_unlock();
89629@@ -2274,7 +2282,7 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
88269 p.iph.ihl = 5; 89630 p.iph.ihl = 5;
88270 p.iph.protocol = IPPROTO_IPV6; 89631 p.iph.protocol = IPPROTO_IPV6;
88271 p.iph.ttl = 64; 89632 p.iph.ttl = 64;
@@ -88274,7 +89635,17 @@ index 50a4c7c..50a27e6 100644
88274 89635
88275 if (ops->ndo_do_ioctl) { 89636 if (ops->ndo_do_ioctl) {
88276 mm_segment_t oldfs = get_fs(); 89637 mm_segment_t oldfs = get_fs();
88277@@ -4412,7 +4412,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, 89638@@ -2557,6 +2565,9 @@ static void init_loopback(struct net_device *dev)
89639 if (sp_ifa->flags & (IFA_F_DADFAILED | IFA_F_TENTATIVE))
89640 continue;
89641
89642+ if (sp_ifa->rt)
89643+ continue;
89644+
89645 sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0);
89646
89647 /* Failure cases are ignored */
89648@@ -4412,7 +4423,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
88278 int *valp = ctl->data; 89649 int *valp = ctl->data;
88279 int val = *valp; 89650 int val = *valp;
88280 loff_t pos = *ppos; 89651 loff_t pos = *ppos;
@@ -88283,7 +89654,7 @@ index 50a4c7c..50a27e6 100644
88283 int ret; 89654 int ret;
88284 89655
88285 /* 89656 /*
88286@@ -4494,7 +4494,7 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write, 89657@@ -4494,7 +4505,7 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write,
88287 int *valp = ctl->data; 89658 int *valp = ctl->data;
88288 int val = *valp; 89659 int val = *valp;
88289 loff_t pos = *ppos; 89660 loff_t pos = *ppos;
@@ -88500,6 +89871,93 @@ index d1e2e8e..51c19ae 100644
88500 msg.msg_controllen = len; 89871 msg.msg_controllen = len;
88501 msg.msg_flags = flags; 89872 msg.msg_flags = flags;
88502 89873
89874diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
89875index bfa6cc3..c3998c2 100644
89876--- a/net/ipv6/mcast.c
89877+++ b/net/ipv6/mcast.c
89878@@ -1343,8 +1343,9 @@ static void ip6_mc_hdr(struct sock *sk, struct sk_buff *skb,
89879 hdr->daddr = *daddr;
89880 }
89881
89882-static struct sk_buff *mld_newpack(struct net_device *dev, int size)
89883+static struct sk_buff *mld_newpack(struct inet6_dev *idev, int size)
89884 {
89885+ struct net_device *dev = idev->dev;
89886 struct net *net = dev_net(dev);
89887 struct sock *sk = net->ipv6.igmp_sk;
89888 struct sk_buff *skb;
89889@@ -1369,7 +1370,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
89890
89891 skb_reserve(skb, hlen);
89892
89893- if (ipv6_get_lladdr(dev, &addr_buf, IFA_F_TENTATIVE)) {
89894+ if (__ipv6_get_lladdr(idev, &addr_buf, IFA_F_TENTATIVE)) {
89895 /* <draft-ietf-magma-mld-source-05.txt>:
89896 * use unspecified address as the source address
89897 * when a valid link-local address is not available.
89898@@ -1465,7 +1466,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc,
89899 struct mld2_grec *pgr;
89900
89901 if (!skb)
89902- skb = mld_newpack(dev, dev->mtu);
89903+ skb = mld_newpack(pmc->idev, dev->mtu);
89904 if (!skb)
89905 return NULL;
89906 pgr = (struct mld2_grec *)skb_put(skb, sizeof(struct mld2_grec));
89907@@ -1485,7 +1486,8 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc,
89908 static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
89909 int type, int gdeleted, int sdeleted)
89910 {
89911- struct net_device *dev = pmc->idev->dev;
89912+ struct inet6_dev *idev = pmc->idev;
89913+ struct net_device *dev = idev->dev;
89914 struct mld2_report *pmr;
89915 struct mld2_grec *pgr = NULL;
89916 struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
89917@@ -1514,7 +1516,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
89918 AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
89919 if (skb)
89920 mld_sendpack(skb);
89921- skb = mld_newpack(dev, dev->mtu);
89922+ skb = mld_newpack(idev, dev->mtu);
89923 }
89924 }
89925 first = 1;
89926@@ -1541,7 +1543,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
89927 pgr->grec_nsrcs = htons(scount);
89928 if (skb)
89929 mld_sendpack(skb);
89930- skb = mld_newpack(dev, dev->mtu);
89931+ skb = mld_newpack(idev, dev->mtu);
89932 first = 1;
89933 scount = 0;
89934 }
89935@@ -1596,8 +1598,8 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
89936 struct sk_buff *skb = NULL;
89937 int type;
89938
89939+ read_lock_bh(&idev->lock);
89940 if (!pmc) {
89941- read_lock_bh(&idev->lock);
89942 for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
89943 if (pmc->mca_flags & MAF_NOREPORT)
89944 continue;
89945@@ -1609,7 +1611,6 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
89946 skb = add_grec(skb, pmc, type, 0, 0);
89947 spin_unlock_bh(&pmc->mca_lock);
89948 }
89949- read_unlock_bh(&idev->lock);
89950 } else {
89951 spin_lock_bh(&pmc->mca_lock);
89952 if (pmc->mca_sfcount[MCAST_EXCLUDE])
89953@@ -1619,6 +1620,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
89954 skb = add_grec(skb, pmc, type, 0, 0);
89955 spin_unlock_bh(&pmc->mca_lock);
89956 }
89957+ read_unlock_bh(&idev->lock);
89958 if (skb)
89959 mld_sendpack(skb);
89960 }
88503diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c 89961diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
88504index 341b54a..591e8ed 100644 89962index 341b54a..591e8ed 100644
88505--- a/net/ipv6/netfilter/ip6_tables.c 89963--- a/net/ipv6/netfilter/ip6_tables.c
@@ -88718,10 +90176,172 @@ index 0ba10e5..c14a4f6 100644
88718 return -ENOMEM; 90176 return -ENOMEM;
88719 } 90177 }
88720diff --git a/net/ipv6/route.c b/net/ipv6/route.c 90178diff --git a/net/ipv6/route.c b/net/ipv6/route.c
88721index e5fe004..9fe3e8e 100644 90179index e5fe004..d8ed9b0 100644
88722--- a/net/ipv6/route.c 90180--- a/net/ipv6/route.c
88723+++ b/net/ipv6/route.c 90181+++ b/net/ipv6/route.c
88724@@ -2881,7 +2881,7 @@ ctl_table ipv6_route_table_template[] = { 90182@@ -65,6 +65,12 @@
90183 #include <linux/sysctl.h>
90184 #endif
90185
90186+enum rt6_nud_state {
90187+ RT6_NUD_FAIL_HARD = -2,
90188+ RT6_NUD_FAIL_SOFT = -1,
90189+ RT6_NUD_SUCCEED = 1
90190+};
90191+
90192 static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
90193 const struct in6_addr *dest);
90194 static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie);
90195@@ -527,26 +533,29 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
90196 return 0;
90197 }
90198
90199-static inline bool rt6_check_neigh(struct rt6_info *rt)
90200+static inline enum rt6_nud_state rt6_check_neigh(struct rt6_info *rt)
90201 {
90202 struct neighbour *neigh;
90203- bool ret = false;
90204+ enum rt6_nud_state ret = RT6_NUD_FAIL_HARD;
90205
90206 if (rt->rt6i_flags & RTF_NONEXTHOP ||
90207 !(rt->rt6i_flags & RTF_GATEWAY))
90208- return true;
90209+ return RT6_NUD_SUCCEED;
90210
90211 rcu_read_lock_bh();
90212 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway);
90213 if (neigh) {
90214 read_lock(&neigh->lock);
90215 if (neigh->nud_state & NUD_VALID)
90216- ret = true;
90217+ ret = RT6_NUD_SUCCEED;
90218 #ifdef CONFIG_IPV6_ROUTER_PREF
90219 else if (!(neigh->nud_state & NUD_FAILED))
90220- ret = true;
90221+ ret = RT6_NUD_SUCCEED;
90222 #endif
90223 read_unlock(&neigh->lock);
90224+ } else {
90225+ ret = IS_ENABLED(CONFIG_IPV6_ROUTER_PREF) ?
90226+ RT6_NUD_SUCCEED : RT6_NUD_FAIL_SOFT;
90227 }
90228 rcu_read_unlock_bh();
90229
90230@@ -560,43 +569,52 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
90231
90232 m = rt6_check_dev(rt, oif);
90233 if (!m && (strict & RT6_LOOKUP_F_IFACE))
90234- return -1;
90235+ return RT6_NUD_FAIL_HARD;
90236 #ifdef CONFIG_IPV6_ROUTER_PREF
90237 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
90238 #endif
90239- if (!rt6_check_neigh(rt) && (strict & RT6_LOOKUP_F_REACHABLE))
90240- return -1;
90241+ if (strict & RT6_LOOKUP_F_REACHABLE) {
90242+ int n = rt6_check_neigh(rt);
90243+ if (n < 0)
90244+ return n;
90245+ }
90246 return m;
90247 }
90248
90249 static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
90250- int *mpri, struct rt6_info *match)
90251+ int *mpri, struct rt6_info *match,
90252+ bool *do_rr)
90253 {
90254 int m;
90255+ bool match_do_rr = false;
90256
90257 if (rt6_check_expired(rt))
90258 goto out;
90259
90260 m = rt6_score_route(rt, oif, strict);
90261- if (m < 0)
90262+ if (m == RT6_NUD_FAIL_SOFT && !IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) {
90263+ match_do_rr = true;
90264+ m = 0; /* lowest valid score */
90265+ } else if (m < 0) {
90266 goto out;
90267+ }
90268+
90269+ if (strict & RT6_LOOKUP_F_REACHABLE)
90270+ rt6_probe(rt);
90271
90272 if (m > *mpri) {
90273- if (strict & RT6_LOOKUP_F_REACHABLE)
90274- rt6_probe(match);
90275+ *do_rr = match_do_rr;
90276 *mpri = m;
90277 match = rt;
90278- } else if (strict & RT6_LOOKUP_F_REACHABLE) {
90279- rt6_probe(rt);
90280 }
90281-
90282 out:
90283 return match;
90284 }
90285
90286 static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
90287 struct rt6_info *rr_head,
90288- u32 metric, int oif, int strict)
90289+ u32 metric, int oif, int strict,
90290+ bool *do_rr)
90291 {
90292 struct rt6_info *rt, *match;
90293 int mpri = -1;
90294@@ -604,10 +622,10 @@ static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
90295 match = NULL;
90296 for (rt = rr_head; rt && rt->rt6i_metric == metric;
90297 rt = rt->dst.rt6_next)
90298- match = find_match(rt, oif, strict, &mpri, match);
90299+ match = find_match(rt, oif, strict, &mpri, match, do_rr);
90300 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric;
90301 rt = rt->dst.rt6_next)
90302- match = find_match(rt, oif, strict, &mpri, match);
90303+ match = find_match(rt, oif, strict, &mpri, match, do_rr);
90304
90305 return match;
90306 }
90307@@ -616,15 +634,16 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
90308 {
90309 struct rt6_info *match, *rt0;
90310 struct net *net;
90311+ bool do_rr = false;
90312
90313 rt0 = fn->rr_ptr;
90314 if (!rt0)
90315 fn->rr_ptr = rt0 = fn->leaf;
90316
90317- match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict);
90318+ match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict,
90319+ &do_rr);
90320
90321- if (!match &&
90322- (strict & RT6_LOOKUP_F_REACHABLE)) {
90323+ if (do_rr) {
90324 struct rt6_info *next = rt0->dst.rt6_next;
90325
90326 /* no entries matched; do round-robin */
90327@@ -1074,10 +1093,13 @@ static void ip6_link_failure(struct sk_buff *skb)
90328
90329 rt = (struct rt6_info *) skb_dst(skb);
90330 if (rt) {
90331- if (rt->rt6i_flags & RTF_CACHE)
90332- rt6_update_expires(rt, 0);
90333- else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT))
90334+ if (rt->rt6i_flags & RTF_CACHE) {
90335+ dst_hold(&rt->dst);
90336+ if (ip6_del_rt(rt))
90337+ dst_free(&rt->dst);
90338+ } else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) {
90339 rt->rt6i_node->fn_sernum = -1;
90340+ }
90341 }
90342 }
90343
90344@@ -2881,7 +2903,7 @@ ctl_table ipv6_route_table_template[] = {
88725 90345
88726 struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net) 90346 struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
88727 { 90347 {
@@ -88731,7 +90351,7 @@ index e5fe004..9fe3e8e 100644
88731 table = kmemdup(ipv6_route_table_template, 90351 table = kmemdup(ipv6_route_table_template,
88732 sizeof(ipv6_route_table_template), 90352 sizeof(ipv6_route_table_template),
88733diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c 90353diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
88734index 02f96dc..4a5a6e5 100644 90354index 02f96dc..58dd9e8 100644
88735--- a/net/ipv6/sit.c 90355--- a/net/ipv6/sit.c
88736+++ b/net/ipv6/sit.c 90356+++ b/net/ipv6/sit.c
88737@@ -74,7 +74,7 @@ static void ipip6_tunnel_setup(struct net_device *dev); 90357@@ -74,7 +74,7 @@ static void ipip6_tunnel_setup(struct net_device *dev);
@@ -88743,6 +90363,15 @@ index 02f96dc..4a5a6e5 100644
88743 90363
88744 static int sit_net_id __read_mostly; 90364 static int sit_net_id __read_mostly;
88745 struct sit_net { 90365 struct sit_net {
90366@@ -624,7 +624,7 @@ static int ipip6_rcv(struct sk_buff *skb)
90367 tunnel->dev->stats.rx_errors++;
90368 goto out;
90369 }
90370- } else {
90371+ } else if (!(tunnel->dev->flags&IFF_POINTOPOINT)) {
90372 if (is_spoofed_6rd(tunnel, iph->saddr,
90373 &ipv6_hdr(skb)->saddr) ||
90374 is_spoofed_6rd(tunnel, iph->daddr,
88746@@ -1486,7 +1486,7 @@ static const struct nla_policy ipip6_policy[IFLA_IPTUN_MAX + 1] = { 90375@@ -1486,7 +1486,7 @@ static const struct nla_policy ipip6_policy[IFLA_IPTUN_MAX + 1] = {
88747 #endif 90376 #endif
88748 }; 90377 };
@@ -90513,6 +92142,142 @@ index f226709..0e735a8 100644
90513 _proto("Tx RESPONSE %%%u", ntohl(hdr->serial)); 92142 _proto("Tx RESPONSE %%%u", ntohl(hdr->serial));
90514 92143
90515 ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len); 92144 ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
92145diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
92146index d51852b..5792252 100644
92147--- a/net/sched/sch_qfq.c
92148+++ b/net/sched/sch_qfq.c
92149@@ -113,7 +113,6 @@
92150
92151 #define FRAC_BITS 30 /* fixed point arithmetic */
92152 #define ONE_FP (1UL << FRAC_BITS)
92153-#define IWSUM (ONE_FP/QFQ_MAX_WSUM)
92154
92155 #define QFQ_MTU_SHIFT 16 /* to support TSO/GSO */
92156 #define QFQ_MIN_LMAX 512 /* see qfq_slot_insert */
92157@@ -189,6 +188,7 @@ struct qfq_sched {
92158 struct qfq_aggregate *in_serv_agg; /* Aggregate being served. */
92159 u32 num_active_agg; /* Num. of active aggregates */
92160 u32 wsum; /* weight sum */
92161+ u32 iwsum; /* inverse weight sum */
92162
92163 unsigned long bitmaps[QFQ_MAX_STATE]; /* Group bitmaps. */
92164 struct qfq_group groups[QFQ_MAX_INDEX + 1]; /* The groups. */
92165@@ -314,6 +314,7 @@ static void qfq_update_agg(struct qfq_sched *q, struct qfq_aggregate *agg,
92166
92167 q->wsum +=
92168 (int) agg->class_weight * (new_num_classes - agg->num_classes);
92169+ q->iwsum = ONE_FP / q->wsum;
92170
92171 agg->num_classes = new_num_classes;
92172 }
92173@@ -340,6 +341,10 @@ static void qfq_destroy_agg(struct qfq_sched *q, struct qfq_aggregate *agg)
92174 {
92175 if (!hlist_unhashed(&agg->nonfull_next))
92176 hlist_del_init(&agg->nonfull_next);
92177+ q->wsum -= agg->class_weight;
92178+ if (q->wsum != 0)
92179+ q->iwsum = ONE_FP / q->wsum;
92180+
92181 if (q->in_serv_agg == agg)
92182 q->in_serv_agg = qfq_choose_next_agg(q);
92183 kfree(agg);
92184@@ -827,38 +832,60 @@ static void qfq_make_eligible(struct qfq_sched *q)
92185 }
92186 }
92187
92188-
92189 /*
92190- * The index of the slot in which the aggregate is to be inserted must
92191- * not be higher than QFQ_MAX_SLOTS-2. There is a '-2' and not a '-1'
92192- * because the start time of the group may be moved backward by one
92193- * slot after the aggregate has been inserted, and this would cause
92194- * non-empty slots to be right-shifted by one position.
92195+ * The index of the slot in which the input aggregate agg is to be
92196+ * inserted must not be higher than QFQ_MAX_SLOTS-2. There is a '-2'
92197+ * and not a '-1' because the start time of the group may be moved
92198+ * backward by one slot after the aggregate has been inserted, and
92199+ * this would cause non-empty slots to be right-shifted by one
92200+ * position.
92201+ *
92202+ * QFQ+ fully satisfies this bound to the slot index if the parameters
92203+ * of the classes are not changed dynamically, and if QFQ+ never
92204+ * happens to postpone the service of agg unjustly, i.e., it never
92205+ * happens that the aggregate becomes backlogged and eligible, or just
92206+ * eligible, while an aggregate with a higher approximated finish time
92207+ * is being served. In particular, in this case QFQ+ guarantees that
92208+ * the timestamps of agg are low enough that the slot index is never
92209+ * higher than 2. Unfortunately, QFQ+ cannot provide the same
92210+ * guarantee if it happens to unjustly postpone the service of agg, or
92211+ * if the parameters of some class are changed.
92212+ *
92213+ * As for the first event, i.e., an out-of-order service, the
92214+ * upper bound to the slot index guaranteed by QFQ+ grows to
92215+ * 2 +
92216+ * QFQ_MAX_AGG_CLASSES * ((1<<QFQ_MTU_SHIFT)/QFQ_MIN_LMAX) *
92217+ * (current_max_weight/current_wsum) <= 2 + 8 * 128 * 1.
92218 *
92219- * If the weight and lmax (max_pkt_size) of the classes do not change,
92220- * then QFQ+ does meet the above contraint according to the current
92221- * values of its parameters. In fact, if the weight and lmax of the
92222- * classes do not change, then, from the theory, QFQ+ guarantees that
92223- * the slot index is never higher than
92224- * 2 + QFQ_MAX_AGG_CLASSES * ((1<<QFQ_MTU_SHIFT)/QFQ_MIN_LMAX) *
92225- * (QFQ_MAX_WEIGHT/QFQ_MAX_WSUM) = 2 + 8 * 128 * (1 / 64) = 18
92226+ * The following function deals with this problem by backward-shifting
92227+ * the timestamps of agg, if needed, so as to guarantee that the slot
92228+ * index is never higher than QFQ_MAX_SLOTS-2. This backward-shift may
92229+ * cause the service of other aggregates to be postponed, yet the
92230+ * worst-case guarantees of these aggregates are not violated. In
92231+ * fact, in case of no out-of-order service, the timestamps of agg
92232+ * would have been even lower than they are after the backward shift,
92233+ * because QFQ+ would have guaranteed a maximum value equal to 2 for
92234+ * the slot index, and 2 < QFQ_MAX_SLOTS-2. Hence the aggregates whose
92235+ * service is postponed because of the backward-shift would have
92236+ * however waited for the service of agg before being served.
92237 *
92238- * When the weight of a class is increased or the lmax of the class is
92239- * decreased, a new aggregate with smaller slot size than the original
92240- * parent aggregate of the class may happen to be activated. The
92241- * activation of this aggregate should be properly delayed to when the
92242- * service of the class has finished in the ideal system tracked by
92243- * QFQ+. If the activation of the aggregate is not delayed to this
92244- * reference time instant, then this aggregate may be unjustly served
92245- * before other aggregates waiting for service. This may cause the
92246- * above bound to the slot index to be violated for some of these
92247- * unlucky aggregates.
92248+ * The other event that may cause the slot index to be higher than 2
92249+ * for agg is a recent change of the parameters of some class. If the
92250+ * weight of a class is increased or the lmax (max_pkt_size) of the
92251+ * class is decreased, then a new aggregate with smaller slot size
92252+ * than the original parent aggregate of the class may happen to be
92253+ * activated. The activation of this aggregate should be properly
92254+ * delayed to when the service of the class has finished in the ideal
92255+ * system tracked by QFQ+. If the activation of the aggregate is not
92256+ * delayed to this reference time instant, then this aggregate may be
92257+ * unjustly served before other aggregates waiting for service. This
92258+ * may cause the above bound to the slot index to be violated for some
92259+ * of these unlucky aggregates.
92260 *
92261 * Instead of delaying the activation of the new aggregate, which is
92262- * quite complex, the following inaccurate but simple solution is used:
92263- * if the slot index is higher than QFQ_MAX_SLOTS-2, then the
92264- * timestamps of the aggregate are shifted backward so as to let the
92265- * slot index become equal to QFQ_MAX_SLOTS-2.
92266+ * quite complex, the above-discussed capping of the slot index is
92267+ * used to handle also the consequences of a change of the parameters
92268+ * of a class.
92269 */
92270 static void qfq_slot_insert(struct qfq_group *grp, struct qfq_aggregate *agg,
92271 u64 roundedS)
92272@@ -1077,7 +1104,7 @@ static struct sk_buff *qfq_dequeue(struct Qdisc *sch)
92273 else
92274 in_serv_agg->budget -= len;
92275
92276- q->V += (u64)len * IWSUM;
92277+ q->V += (u64)len * q->iwsum;
92278 pr_debug("qfq dequeue: len %u F %lld now %lld\n",
92279 len, (unsigned long long) in_serv_agg->F,
92280 (unsigned long long) q->V);
90516diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c 92281diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
90517index 391a245..296b3d7 100644 92282index 391a245..296b3d7 100644
90518--- a/net/sctp/ipv6.c 92283--- a/net/sctp/ipv6.c
@@ -94305,6 +96070,63 @@ index 7d8803a..559f8d0 100644
94305 96070
94306 list_add(&s->list, &cs4297a_devs); 96071 list_add(&s->list, &cs4297a_devs);
94307 96072
96073diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
96074index dafe04a..660552c 100644
96075--- a/sound/pci/hda/patch_sigmatel.c
96076+++ b/sound/pci/hda/patch_sigmatel.c
96077@@ -418,9 +418,11 @@ static void stac_update_outputs(struct hda_codec *codec)
96078 val &= ~spec->eapd_mask;
96079 else
96080 val |= spec->eapd_mask;
96081- if (spec->gpio_data != val)
96082+ if (spec->gpio_data != val) {
96083+ spec->gpio_data = val;
96084 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir,
96085 val);
96086+ }
96087 }
96088 }
96089
96090@@ -3228,7 +3230,7 @@ static const struct hda_fixup stac927x_fixups[] = {
96091 /* configure the analog microphone on some laptops */
96092 { 0x0c, 0x90a79130 },
96093 /* correct the front output jack as a hp out */
96094- { 0x0f, 0x0227011f },
96095+ { 0x0f, 0x0221101f },
96096 /* correct the front input jack as a mic */
96097 { 0x0e, 0x02a79130 },
96098 {}
96099@@ -3608,20 +3610,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
96100 static int stac_init(struct hda_codec *codec)
96101 {
96102 struct sigmatel_spec *spec = codec->spec;
96103- unsigned int gpio;
96104 int i;
96105
96106 /* override some hints */
96107 stac_store_hints(codec);
96108
96109 /* set up GPIO */
96110- gpio = spec->gpio_data;
96111 /* turn on EAPD statically when spec->eapd_switch isn't set.
96112 * otherwise, unsol event will turn it on/off dynamically
96113 */
96114 if (!spec->eapd_switch)
96115- gpio |= spec->eapd_mask;
96116- stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, gpio);
96117+ spec->gpio_data |= spec->eapd_mask;
96118+ stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
96119
96120 snd_hda_gen_init(codec);
96121
96122@@ -3930,6 +3930,7 @@ static void stac_setup_gpio(struct hda_codec *codec)
96123 {
96124 struct sigmatel_spec *spec = codec->spec;
96125
96126+ spec->gpio_mask |= spec->eapd_mask;
96127 if (spec->gpio_led) {
96128 if (!spec->vref_mute_led_nid) {
96129 spec->gpio_mask |= spec->gpio_led;
94308diff --git a/sound/pci/ymfpci/ymfpci.h b/sound/pci/ymfpci/ymfpci.h 96130diff --git a/sound/pci/ymfpci/ymfpci.h b/sound/pci/ymfpci/ymfpci.h
94309index 4631a23..001ae57 100644 96131index 4631a23..001ae57 100644
94310--- a/sound/pci/ymfpci/ymfpci.h 96132--- a/sound/pci/ymfpci/ymfpci.h
@@ -94388,6 +96210,19 @@ index bb23009..db346c2 100644
94388 return s->unit_minor; 96210 return s->unit_minor;
94389 96211
94390 fail: 96212 fail:
96213diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c
96214index 40dd50a..6d0a6d1 100644
96215--- a/sound/usb/6fire/pcm.c
96216+++ b/sound/usb/6fire/pcm.c
96217@@ -543,7 +543,7 @@ static snd_pcm_uframes_t usb6fire_pcm_pointer(
96218 snd_pcm_uframes_t ret;
96219
96220 if (rt->panic || !sub)
96221- return SNDRV_PCM_STATE_XRUN;
96222+ return SNDRV_PCM_POS_XRUN;
96223
96224 spin_lock_irqsave(&sub->lock, flags);
96225 ret = sub->dma_off;
94391diff --git a/tools/gcc/.gitignore b/tools/gcc/.gitignore 96226diff --git a/tools/gcc/.gitignore b/tools/gcc/.gitignore
94392new file mode 100644 96227new file mode 100644
94393index 0000000..50f2f2f 96228index 0000000..50f2f2f