Push to branch refs/heads/master: 64f90251ae7069065d0b50775f97a74f6913bb81 --> 25f8c2313948296727d1ff5677d11de4c137eccf
Documentation/filesystems/00-INDEX | 2 + Documentation/filesystems/wrapfs.txt | 172 +++++++++ MAINTAINERS | 9 + Makefile | 2 +- arch/arm/mach-pxa/include/mach/pxa27x.h | 2 +- arch/arm/mach-pxa/pxa27x.c | 2 +- arch/arm/mm/proc-v7.S | 4 +- arch/mips/include/asm/atomic.h | 2 +- arch/parisc/kernel/signal.c | 67 +++- arch/x86/kernel/head_64.S | 8 + arch/x86/kernel/signal.c | 17 +- arch/x86/kernel/verify_cpu.S | 12 +- block/partitions/mac.c | 10 +- crypto/ablkcipher.c | 2 +- crypto/algif_hash.c | 12 +- crypto/blkcipher.c | 2 +- drivers/acpi/osl.c | 9 +- drivers/ata/libahci.c | 9 + drivers/ata/sata_sil.c | 3 + drivers/block/xen-blkback/common.h | 8 +- drivers/bluetooth/ath3k.c | 2 + drivers/bluetooth/btusb.c | 1 + drivers/firewire/ohci.c | 5 + drivers/gpu/drm/radeon/radeon_irq_kms.c | 5 + drivers/gpu/vga/vgaarb.c | 6 +- drivers/hid/hid-core.c | 2 +- drivers/iommu/intel-iommu.c | 7 +- drivers/isdn/gigaset/ser-gigaset.c | 10 +- drivers/isdn/hardware/mISDN/mISDNipac.c | 7 +- drivers/md/dm-mpath.c | 7 +- drivers/md/persistent-data/dm-btree.c | 20 +- drivers/md/raid1.c | 3 - drivers/mtd/mtdpart.c | 4 +- drivers/net/can/sja1000/sja1000.c | 3 + drivers/net/ethernet/renesas/sh_eth.c | 3 +- drivers/net/macvlan.c | 2 + drivers/net/phy/broadcom.c | 2 +- drivers/net/wan/x25_asy.c | 6 +- drivers/net/wireless/mwifiex/debugfs.c | 14 +- drivers/net/xen-netback/netback.c | 34 +- drivers/parisc/iommu-helpers.h | 15 +- drivers/power/wm831x_power.c | 6 +- drivers/scsi/megaraid/megaraid_sas.h | 2 + drivers/scsi/megaraid/megaraid_sas_base.c | 15 +- drivers/scsi/scsi_sysfs.c | 18 +- drivers/scsi/ses.c | 30 +- drivers/spi/spi.c | 2 +- drivers/staging/iio/adc/lpc32xx_adc.c | 4 +- drivers/staging/rtl8712/usb_intf.c | 1 + drivers/tty/tty_buffer.c | 3 +- drivers/usb/class/usblp.c | 2 +- drivers/usb/core/hub.c | 29 +- drivers/usb/core/otg_whitelist.h | 5 - drivers/usb/core/quirks.c | 8 - drivers/usb/host/whci/qset.c | 4 + drivers/usb/host/xhci.c | 8 + drivers/usb/musb/musb_core.c | 10 +- drivers/usb/serial/cp210x.c | 1 - drivers/usb/serial/ipaq.c | 3 +- drivers/usb/serial/option.c | 11 + drivers/usb/serial/ti_usb_3410_5052.c | 4 +- drivers/xen/xen-pciback/pciback.h | 1 + drivers/xen/xen-pciback/pciback_ops.c | 79 +++- fs/9p/vfs_inode.c | 4 +- fs/Kconfig | 1 + fs/Makefile | 1 + fs/binfmt_elf.c | 10 +- fs/btrfs/inode.c | 10 +- fs/cachefiles/rdwr.c | 78 ++-- fs/ext4/ext4.h | 51 ++- fs/ext4/super.c | 12 +- fs/fscache/netfs.c | 34 +- fs/fscache/page.c | 2 +- fs/fuse/file.c | 2 +- fs/jbd2/journal.c | 6 +- fs/jbd2/transaction.c | 2 + fs/nfs/inode.c | 6 +- fs/ocfs2/resize.c | 15 +- fs/splice.c | 8 + fs/sysv/inode.c | 10 +- fs/wrapfs/Kconfig | 9 + fs/wrapfs/Makefile | 7 + fs/wrapfs/dentry.c | 52 +++ fs/wrapfs/file.c | 377 ++++++++++++++++++ fs/wrapfs/inode.c | 623 ++++++++++++++++++++++++++++++ fs/wrapfs/lookup.c | 325 ++++++++++++++++ fs/wrapfs/main.c | 175 +++++++++ fs/wrapfs/mmap.c | 94 +++++ fs/wrapfs/super.c | 208 ++++++++++ fs/wrapfs/wrapfs.h | 208 ++++++++++ include/linux/acpi.h | 6 + include/linux/enclosure.h | 4 + include/linux/jbd2.h | 1 + include/linux/magic.h | 2 + include/linux/mm.h | 1 + include/linux/usb/quirks.h | 3 - include/net/af_unix.h | 5 +- include/net/ip6_fib.h | 1 + include/net/ndisc.h | 2 + include/net/sctp/structs.h | 3 +- include/xen/interface/io/ring.h | 14 + kernel/events/core.c | 4 + kernel/irq/manage.c | 6 +- kernel/sched/core.c | 6 +- kernel/time/ntp.c | 45 ++- kernel/time/timekeeping.c | 37 +- kernel/trace/ring_buffer.c | 12 +- lib/devres.c | 2 +- mm/backing-dev.c | 19 +- mm/hugetlb.c | 22 +- mm/memory.c | 39 +- mm/memory_hotplug.c | 31 +- mm/vmstat.c | 6 +- net/core/datagram.c | 3 +- net/core/dev.c | 3 + net/core/dst.c | 3 +- net/core/neighbour.c | 4 +- net/ipv4/tcp_input.c | 13 +- net/ipv4/tcp_ipv4.c | 3 +- net/ipv4/udp.c | 6 +- net/ipv6/addrlabel.c | 2 +- net/ipv6/af_inet6.c | 6 + net/ipv6/ip6_fib.c | 6 +- net/ipv6/ip6mr.c | 17 +- net/ipv6/ndisc.c | 18 +- net/ipv6/route.c | 36 +- net/ipv6/tunnel6.c | 12 +- net/ipv6/udp.c | 6 +- net/mac80211/mesh_pathtbl.c | 8 +- net/mac80211/mlme.c | 2 +- net/rfkill/core.c | 6 +- net/sctp/auth.c | 4 +- net/sctp/outqueue.c | 1 + net/sctp/sm_sideeffect.c | 34 +- net/sctp/sm_statefuns.c | 3 +- net/socket.c | 38 +- net/unix/garbage.c | 12 +- scripts/recordmcount.c | 137 +++++-- scripts/recordmcount.h | 2 +- security/keys/keyctl.c | 18 +- sound/pci/hda/hda_intel.c | 2 + sound/pci/hda/patch_sigmatel.c | 1 + sound/pci/rme96.c | 41 +- sound/soc/codecs/wm8962.c | 4 +- sound/usb/midi.c | 46 +++ sound/usb/quirks-table.h | 11 + sound/usb/quirks.c | 1 + sound/usb/usbaudio.h | 1 + 148 files changed, 3391 insertions(+), 478 deletions(-) commit 25f8c2313948296727d1ff5677d11de4c137eccf Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun May 22 01:27:13 2016 -0400 Wrapfs: support NFS exports Based on patch from Sandeep Joshi <sanjos...@gmail.com>. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit f31068af62fe7402f1ad5f44eb2085bfeeec6cf0 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun May 22 01:27:13 2016 -0400 Wrapfs: use d_splice_alias Refactor interpose code to allow lookup to use d_splice_alias. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit fdd1350740528274905438119b772da3b949c243 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Dec 14 18:38:16 2015 -0500 Wrapfs: update nlinks after rename Signed-off-by: Logeswari P Viswanath <logeswari...@hpe.com> Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 065eeb0ef7169ee6fb0e6304219f6e64ef9db0f6 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Nov 4 01:24:29 2015 -0500 Wrapfs: update copyright year to 2015 commit 239ab9c78a98b19eac182b2966a1f3334f88ce2a Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Nov 4 01:24:29 2015 -0500 Wrapfs: use vfs xattr helpers Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c656f0950ad620882294e9839703a05ddf6699cf Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Aug 15 23:22:26 2014 -0400 Wrapfs: properly copy meta-data after AIO operations from lower inode Signed-off-by: Mengyang Li <li.mengy...@stonybrook.edu> Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit d48f0b93a92cbf7f4dd33dfa7342863ef8f4258d Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Aug 11 18:59:28 2014 -0400 Wrapfs: leave placeholders for updating upper inode after AIO Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 68537a8a863e693e0bcae0da379cc5a70fd4aaff Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun Aug 10 02:25:45 2014 -0400 Wrapfs: protect lower_file by ref-count during aio operation Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> Signed-off-by: Mengyang Li <li.mengy...@stonybrook.edu> commit 8f1acaa27ef296251b9a3ffd625cc7bc2566e3f0 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Jun 25 23:22:55 2014 -0400 Wrapfs: fix ->llseek to update upper and lower offsets Fixes bug: xfstests generic/257. f_pos consistently is required by and only by dir_ops->wrapfs_readdir, main_ops is not affected. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> Signed-off-by: Mengyang Li <li.mengy...@stonybrook.edu> commit d3f8d91c100066d15a697f99ee90e860c63edcf2 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Jun 25 23:22:55 2014 -0400 Wrapfs: support extended attributes (xattr) operations Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> Signed-off-by: Mengyang Li <li.mengy...@stonybrook.edu> commit aa38e2fc071ed8f9c1c214e9b6fe81c9387745d5 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Jun 20 20:28:12 2014 -0400 Wrapfs: support asynchronous-IO (AIO) operations Signed-off-by: Li Mengyang <li.mengy...@stonybrook.edu> Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 867a3eb17a6bfd6e5f5d494740a6d0953931daeb Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Jun 20 20:28:12 2014 -0400 Wrapfs: support direct-IO (DIO) operations Signed-off-by: Li Mengyang <li.mengy...@stonybrook.edu> Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 1b47df04c339fa745e123beeaf7944f4b704366a Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu May 15 00:16:05 2014 -0400 Wrapfs: implement vm_ops->page_mkwrite Some file systems (e.g., ext4) require it. Reported by Ted Ts'o. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 70c48be4fa030826865e5006aeb8c01b933787c2 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Apr 3 14:12:09 2014 -0400 Wrapfs: update documentation Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 71906faf7cd1e2489c60c989e5429e71c33523e2 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Apr 3 14:12:00 2014 -0400 Wrapfs: update maintainers Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 76dd3055c50ed3ae1642ac8c32d542897b44b910 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Jan 21 03:23:10 2014 -0500 Wrapfs: update documentation Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 215a80e5c04086c5cb3fa3bd7e6df28cee13ffbf Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Jan 21 01:17:55 2014 -0500 Wrapfs: 2014 Copyright update Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 4915ecf48c3c76036d3d1b5c9cee9365c8baad00 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Jun 5 01:44:38 2013 -0400 Wrapfs: copy lower inode attributes in ->ioctl Some ioctls (e.g., EXT2_IOC_SETFLAGS) can change inode attributes, so copy them from lower inode. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c749a0a7295c272413e1782995f92afbfd345fa0 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Wed Jun 5 01:43:38 2013 -0400 Wrapfs: remove unnecessary call to vm_unmap in ->mmap Code is unnecessary and causes deadlocks in newer kernels. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit e56a233cca23355fba8d072e8af539f178aa7118 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun Jun 2 21:55:33 2013 -0400 patch copyright-2013.patch commit 34a1230cf6b59b6ea133b9912833ed1337786b31 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sat May 25 23:23:42 2013 -0400 Wrapfs: use d_make_root Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 3420fb12aa0aef03bd8c3620963dbf77e87e4690 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Jan 31 04:40:19 2012 -0500 Wrapfs: use mode_t Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit a08bef3abe984a5b31520632fdbaaaddaa6cfbaf Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun Jan 29 20:34:27 2012 -0500 Wrapfs: use set_nlink() Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 28b4e83fe1a9ff4d3f4d6b1b1607d5092a6ecd01 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Sep 9 00:47:49 2011 -0400 Wrapfs: drop our dentry in ->rmdir Also clear nlinks on our inode. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 86a841977518bd24881229324c5b8ff9625e86f5 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:32 2011 -0400 Wrapfs: use d_alloc_root Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit fa0bd44cfbe5a2866a5504342e1dbb828e5cc691 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:31 2011 -0400 Wrapfs: use d_set_d_op Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 09bca468a107445987b37b4ed0ea1f06263c5a6e Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:30 2011 -0400 Wrapfs: use updated vfs_path_lookup prototype Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 7d05281388d3b43adb9e4ccd0e4b7e435155e348 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:30 2011 -0400 Wrapfs: ->fsync updates for new prototype Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 1f2e7b7449a9709439a8290419ccdaeed56f97e3 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:29 2011 -0400 Wrapfs: support LOOKUP_RCU in ->d_revalidate Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit f342b0b2e1b7695ff740d55cdb4619d849da6887 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Sep 6 00:10:28 2011 -0400 Wrapfs: new ->permission prototype and fixes. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit b1a643a3473bb5d8d71cb104056bc08fb6440344 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon May 2 02:00:02 2011 -0400 Wrapfs: lookup fixes Don't use lookup_one_len any longer (doesn't work for NFS). Initialize lower wrapfs_dentry_info so lower_path is NULL. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 04e1e18d057d0a47b66d04ccff5035124133c3ae Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Mar 18 13:14:28 2011 -0400 Wrapfs: remove extra debug in rmdir Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 785bc034653f2a1f9d7b65590a00963f3c2d3a88 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Mar 18 12:38:01 2011 -0400 Wrapfs: checkpatch fixes Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 77ffef02ac1e18e45ab5014d36704bdaea63045f Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Mar 18 00:45:17 2011 -0400 Wrapfs: port to 2.6.39 Remove lock/unlock_kernel in ->fasync. Convert from ->get_sb to ->mount op. Remove include to smp_lock.h, added sched.h. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 256b5125ca9e540270ec662e21c2f74d776a6447 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Mar 17 23:21:55 2011 -0400 Wrapfs: copyright update for 2011 Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 534f03be2d2a41af7c373e3ab1e8c2898b30cada Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Mar 17 23:21:55 2011 -0400 Wrapfs: better handling of NFS silly-renamed files In ->unlink, if we try to unlink an NFS silly-renamed file, NFS returns -EBUSY. We have to treat it as a success and return 0 to the VFS. NFS will remove silly-deleted files later on anyway. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit d9482640e6215657b39a351aa6a7f09137c43169 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Mar 17 23:21:55 2011 -0400 Wrapfs: update parent directory inode size in inode ops After ->unlink, ->rmdir, and ->rename, we need to copy the (possibly changed) inode size of the parent directory(ies) where the operation took place. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit af1e50f3fb2dec2b6a281486ea96d37c3bbcb24e Author: Erez Zadok <e...@cs.sunysb.edu> Date: Thu Mar 17 23:21:55 2011 -0400 Wrapfs: remove unnecessary calls to copy lower inode->n_links Removed from ->create, ->symlink, and ->mknod. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit d702fcedb808fa95dd19e8ecc1e7ce5b9f6d2f92 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Mar 7 23:20:33 2011 -0500 Wrapfs: ->setattr fixes Call inode_change_ok on our inode, not lower. Don't copy inode sizes (VFS does it). Pass lower file in struct iattr passed to notify_change on lower inode. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 6415e667ccacbaf6a59ed7986bec2a3030daf5e9 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sun Mar 6 16:23:16 2011 -0500 Wrapfs: update ->permission prototye and code for new iperm flag Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c9875b12676d8af20f8e85c9b4e4284860dc0329 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Nov 12 18:15:05 2010 -0500 Wrapfs: handle maxbytes properly Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 60d0142ec64950ea4ed8e2c205c1ec703902fb9a Author: Erez Zadok <e...@cs.sunysb.edu> Date: Sat Sep 11 15:49:33 2010 -0400 Wrapfs: support ->unlocked_ioctl and ->compat_ioctl Old ->ioctl was split into ->unlocked_ioctl and ->compat_ioctl. Compat version doesn't need to lock_kernel any longer. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c7abb54566d89e189e486c9e8a0c49a8d31ccc86 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Aug 10 23:50:14 2010 -0400 Wrapfs: new vfs_statfs and ->evict_inode prototypes Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 9aa1e318925a5d12b76d479581575c4c7a1b9c17 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Aug 6 23:37:29 2010 -0400 Wrapfs: update ->fsync prototype Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit cb7fabbde77a69e4148da606002ab798ddeb5483 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Apr 20 21:22:02 2010 -0400 Wrapfs: update documentation Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 9144f4d7646560f756a12333e7276732c3f5dbdc Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Apr 20 15:32:09 2010 -0400 Wrapfs: include slab.h Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c2f3afc643bace0afef8471cbed1e3eff602f75b Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Apr 20 15:26:02 2010 -0400 Wrapfs: avoid an extra path_get/put pair in wrapfs_open Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 14267d29dbc9754ed4c126b42bb7c58aa213baa7 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Fri Feb 26 03:18:04 2010 -0500 Wrapfs: decrement nd_path on follow_link error Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit bef7cb5a32c70d26a9f0187b1766275ea02f9ce0 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Jan 5 04:27:00 2010 -0500 Wrapfs: don't mention kernel version in modload message Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 50f3f0fb13df80d50d24c7f275efc158f93fc091 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Tue Jan 5 04:28:11 2010 -0500 Wrapfs/VFS: remove init_lower_nd and unexport release_lower_nd Only wrapfs_create used it, and it is unnecessary to init a completely new nameidata for the lower file system. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 410eae193467bb82a0535e65f451fcc76820ff62 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Kconfig: hook to configure Wrapfs Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit e3f126f4b6a72f5598fa54fd03717cb98903c0e3 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Makefile: hook to compile Wrapfs Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit ae2a9c94afa9ba26f624dc2aa316dd68eed44cae Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 VFS: export release_open_intent symbol Needed to release the resources of the lower nameidata structures that we create and pass to lower file systems (e.g., when calling vfs_create). Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit a8e5bc6ed71cfa13fecfa5c596e81ff817e960b0 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: file system magic number Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 778c0738bc1f3772dc68ec51c451af77afc0464a Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: Kconfig options Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit ba63c6cfd8c0ec6c2f77d6cdb4abc94da9919049 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: main Makefile Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit cde1f3beef2e08faae90d39327d8f90bd9c22c86 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: vm_ops operations Includes necessary address_space workaround ops. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 5b7d5925d879cf2f53164c564d184317981610de Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: mount-time and module-linkage functions Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit ebf0ce219dbc85f4515362218da429870745cf7c Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: lookup-related functions Main lookup function, nameidata helpers, and stacking-interposition functions. Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c0a4e1472dfe1d0fc1bad7f9be88c6e7386b7285 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: file operations Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit e97ef8499348e2237add8f8a44a7cbb8c6c5b639 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: dentry operations Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit fa18832f9a7a5bc7cdc225cb9eb12e66efd93f2e Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: inode operations Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 47eed82adc1b8bf890f9161bd03e3547651a065b Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: superblock operations Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit f59cdefd03bf701e1cdb705409d859dd036db58a Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: main header file Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 14fb455dd24f93c27565e946716ad843b533a460 Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: Maintainers Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit d1c27c430f0da655e6b8b4c9252578e9927e8ffd Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Documentation: index entry for Wrapfs Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit c7c83687a41536a51a5fe5eb38bd1b05d6a10f5c Author: Erez Zadok <e...@cs.sunysb.edu> Date: Mon Jan 4 20:45:06 2010 -0500 Wrapfs: introduction and usage documentation Signed-off-by: Erez Zadok <e...@cs.sunysb.edu> commit 8d1988f838a95e836342b505398d38b223181f17 Author: Zefan Li <lize...@huawei.com> Date: Wed Oct 26 23:15:47 2016 +0800 Linux 3.4.113 commit 887cbce4a7f533aef33da6747aaf63b54a814cc1 Author: Arnaldo Carvalho de Melo <a...@redhat.com> Date: Mon Mar 14 09:56:35 2016 -0300 net: Fix use after free in the recvmmsg exit path commit 34b88a68f26a75e4fded796f1a49c40f82234b7d upstream. The syzkaller fuzzer hit the following use-after-free: Call Trace: [<ffffffff8175ea0e>] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:295 [<ffffffff851cc31a>] __sys_recvmmsg+0x6fa/0x7f0 net/socket.c:2261 [< inline >] SYSC_recvmmsg net/socket.c:2281 [<ffffffff851cc57f>] SyS_recvmmsg+0x16f/0x180 net/socket.c:2270 [<ffffffff86332bb6>] entry_SYSCALL_64_fastpath+0x16/0x7a arch/x86/entry/entry_64.S:185 And, as Dmitry rightly assessed, that is because we can drop the reference and then touch it when the underlying recvmsg calls return some packets and then hit an error, which will make recvmmsg to set sock->sk->sk_err, oops, fix it. Reported-and-Tested-by: Dmitry Vyukov <dvyu...@google.com> Cc: Alexander Potapenko <gli...@google.com> Cc: Eric Dumazet <eduma...@google.com> Cc: Kostya Serebryany <k...@google.com> Cc: Sasha Levin <sasha.le...@oracle.com> Fixes: a2e2725541fa ("net: Introduce recvmmsg socket syscall") http://lkml.kernel.org/r/20160122211644.gc2...@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com> Signed-off-by: David S. Miller <da...@davemloft.net> Signed-off-by: Zefan Li <lize...@huawei.com> commit 1c8544a93151329be95f702f6f4029f860b77ee7 Author: Michal Hocko <mho...@suse.com> Date: Sun Oct 16 11:55:00 2016 +0200 mm, gup: close FOLL MAP_PRIVATE race commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 upstream. faultin_page drops FOLL_WRITE after the page fault handler did the CoW and then we retry follow_page_mask to get our CoWed page. This is racy, however because the page might have been unmapped by that time and so we would have to do a page fault again, this time without CoW. This would cause the page cache corruption for FOLL_FORCE on MAP_PRIVATE read only mappings with obvious consequences. This is an ancient bug that was actually already fixed once by Linus eleven years ago in commit 4ceb5db9757a ("Fix get_user_pages() race for write access") but that was then undone due to problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug") because s390 didn't have proper dirty pte tracking until abf09bed3cce ("s390/mm: implement software dirty bits"). This wasn't a problem at the time as pointed out by Hugh Dickins because madvise relied on mmap_sem for write up until 0a27a14a6292 ("mm: madvise avoid exclusive mmap_sem") but since then we can race with madvise which can unmap the fresh COWed page or with KSM and corrupt the content of the shared page. This patch is based on the Linus' approach to not clear FOLL_WRITE after the CoW page fault (aka VM_FAULT_WRITE) but instead introduces FOLL_COW to note this fact. The flag is then rechecked during follow_pfn_pte to enforce the page fault again if we do not see the CoWed page. Linus was suggesting to check pte_dirty again as s390 is OK now. But that would make backporting to some old kernels harder. So instead let's just make sure that vm_normal_page sees a pure anonymous page. This would guarantee we are seeing a real CoW page. Introduce can_follow_write_pte which checks both pte_write and falls back to PageAnon on forced write faults which passed CoW already. Thanks to Hugh to point out that a special care has to be taken for KSM pages because our COWed page might have been merged with a KSM one and keep its PageAnon flag. Fixes: 0a27a14a6292 ("mm: madvise avoid exclusive mmap_sem") Reported-by: Phil "not Paul" Oester <ker...@linuxace.com> Disclosed-by: Andy Lutomirski <l...@kernel.org> Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> Signed-off-by: Michal Hocko <mho...@suse.com> [bwh: Backported to 3.2: - Adjust filename, context, indentation - The 'no_page' exit path in follow_page() is different, so open-code the cleanup - Delete a now-unused label] Signed-off-by: Ben Hutchings <b...@decadent.org.uk> Signed-off-by: Zefan Li <lize...@huawei.com> commit 86eecef7f9d182c759c687020a504235c6bef903 Author: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Date: Tue Nov 17 15:49:06 2015 +0100 net/core: revert "net: fix __netdev_update_features return.." and add comment commit 17b85d29e82cc3c874a497a8bc5764d6a2b043e2 upstream. This reverts commit 00ee59271777 ("net: fix __netdev_update_features return on ndo_set_features failure") and adds a comment explaining why it's okay to return a value other than 0 upon error. Some drivers might actually change flags and return an error so it's better to fire a spurious notification rather than miss these. CC: MichaÅ MirosÅaw <mirq-li...@rere.qmqm.pl> Signed-off-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Signed-off-by: David S. Miller <da...@davemloft.net> Signed-off-by: Zefan Li <lize...@huawei.com> commit 17fd6bbdac823dac8ecc7a33a7fa42238d9da5ed Author: Paul Bolle <pebo...@tiscali.nl> Date: Thu Feb 18 21:29:08 2016 +0100 ser_gigaset: use container_of() instead of detour commit 8d2c3ab4445640957d136caa3629857d63544a2a upstream. The purpose of gigaset_device_release() is to kfree() the struct ser_cardstate that contains our struct device. This is done via a bit of a detour. First we make our struct device's driver_data point to the container of our struct ser_cardstate (which is a struct cardstate). In gigaset_device_release() we then retrieve that driver_data again. And after that we finally kfree() the struct ser_cardstate that was saved in the struct cardstate. All of this can be achieved much easier by using container_of() to get from our struct device to its container, struct ser_cardstate. Do so. Note that at the time the detour was implemented commit b8b2c7d845d5 ("base/platform: assert that dev_pm_domain callbacks are called unconditionally") had just entered the tree. That commit disconnected our platform_device and our platform_driver. These were reconnected again in v4.5-rc2 through commit 25cad69f21f5 ("base/platform: Fix platform drivers with no probe callback"). And one of the consequences of that fix was that it broke the detour via driver_data. That's because it made __device_release_driver() stop being a NOP for our struct device and actually do stuff again. One of the things it now does, is setting our driver_data to NULL. That, in turn, makes it impossible for gigaset_device_release() to get to our struct cardstate. Which has the net effect of leaking a struct ser_cardstate at every call of this driver's tty close() operation. So using container_of() has the additional benefit of actually working. Reported-by: Dmitry Vyukov <dvyu...@google.com> Tested-by: Dmitry Vyukov <dvyu...@google.com> Signed-off-by: Paul Bolle <pebo...@tiscali.nl> Acked-by: Tilman Schmidt <til...@imap.cc> Signed-off-by: David S. Miller <da...@davemloft.net> Signed-off-by: Zefan Li <lize...@huawei.com> commit 344288395a42ce1959a452e4f3a8543f1c012efe Author: Tilman Schmidt <til...@imap.cc> Date: Tue Dec 15 18:11:31 2015 +0100 ser_gigaset: remove unnecessary kfree() calls from release method commit 8aeb3c3d655e22d3aa5ba49f313157bd27354bb4 upstream. device->platform_data and platform_device->resource are never used and remain NULL through their entire life. Drops the kfree() calls for them from the device release method. Signed-off-by: Tilman Schmidt <til...@imap.cc> Signed-off-by: Paul Bolle <pebo...@tiscali.nl> Signed-off-by: David S. Miller <da...@davemloft.net> Signed-off-by: Zefan Li <lize...@huawei.com> commit 658ba629ae9263312ea373c5f9faac0b2dabf070 Author: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Date: Thu Feb 11 16:10:24 2016 -0500 xen/pciback: Save the number of MSI-X entries to be copied later. commit d159457b84395927b5a52adb72f748dd089ad5e5 upstream. Commit 8135cf8b092723dbfcc611fe6fdcb3a36c9951c5 (xen/pciback: Save xen_pci_op commands before processing it) broke enabling MSI-X because it would never copy the resulting vectors into the response. The number of vectors requested was being overwritten by the return value (typically zero for success). Save the number of vectors before processing the op, so the correct number of vectors are copied afterwards. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Reviewed-by: Jan Beulich <jbeul...@suse.com> Signed-off-by: David Vrabel <david.vra...@citrix.com> Signed-off-by: Zefan Li <lize...@huawei.com> commit 98c6556471132b8676f9ab6536e501475dce7df2 Author: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> Date: Fri Feb 5 15:36:30 2016 -0800 mm, vmstat: fix wrong WQ sleep when memory reclaim doesn't make any progress commit 564e81a57f9788b1475127012e0fd44e9049e342 upstream. Jan Stancek has reported that system occasionally hanging after "oom01" testcase from LTP triggers OOM. Guessing from a result that there is a kworker thread doing memory allocation and the values between "Node 0 Normal free:" and "Node 0 Normal:" differs when hanging, vmstat is not up-to-date for some reason. According to commit 373ccbe59270 ("mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress"), it meant to force the kworker thread to take a short sleep, but it by error used schedule_timeout(1). We missed that schedule_timeout() in state TASK_RUNNING doesn't do anything. Fix it by using schedule_timeout_uninterruptible(1) which forces the kworker thread to take a short sleep in order to make sure that vmstat is up-to-date. Fixes: 373ccbe59270 ("mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress") Signed-off-by: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> Reported-by: Jan Stancek <jstan...@redhat.com> Acked-by: Michal Hocko <mho...@suse.com> Cc: Tejun Heo <t...@kernel.org> Cc: Cristopher Lameter <clame...@sgi.com> Cc: Joonsoo Kim <iamjoonsoo....@lge.com> Cc: Arkadiusz Miskiewicz <ar...@maven.pl> Signed-off-by: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> Signed-off-by: Zefan Li <lize...@huawei.com> commit 8c095d35c42284d6d8cd792c01afd7cdeba475db Author: John Stultz <john.stu...@linaro.org> Date: Thu Jun 11 15:54:55 2015 -0700 time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge commit 833f32d763028c1bb371c64f457788b933773b3e upstream. Currently, leapsecond adjustments are done at tick time. As a result, the leapsecond was applied at the first timer tick *after* the leapsecond (~1-10ms late depending on HZ), rather then exactly on the second edge. This was in part historical from back when we were always tick based, but correcting this since has been avoided since it adds extra conditional checks in the gettime fastpath, which has performance overhead. However, it was recently pointed out that ABS_TIME CLOCK_REALTIME timers set for right after the leapsecond could fire a second early, since some timers may be expired before we trigger the timekeeping timer, which then applies the leapsecond. This isn't quite as bad as it sounds, since behaviorally it is similar to what is possible w/ ntpd made leapsecond adjustments done w/o using the kernel discipline. Where due to latencies, timers may fire just prior to the settimeofday call. (Also, one should note that all applications using CLOCK_REALTIME timers should always be careful, since they are prone to quirks from settimeofday() disturbances.) However, the purpose of having the kernel do the leap adjustment is to avoid such latencies, so I think this is worth fixing. So in order to properly keep those timers from firing a second early, this patch modifies the ntp and timekeeping logic so that we keep enough state so that the update_base_offsets_now accessor, which provides the hrtimer core the current time, can check and apply the leapsecond adjustment on the second edge. This prevents the hrtimer core from expiring timers too early. This patch does not modify any other time read path, so no additional overhead is incurred. However, this also means that the leap-second continues to be applied at tick time for all other read-paths. Apologies to Richard Cochran, who pushed for similar changes years ago, which I resisted due to the concerns about the performance overhead. While I suspect this isn't extremely critical, folks who care about strict leap-second correctness will likely want to watch this. Potentially a -stable candidate eventually. Originally-suggested-by: Richard Cochran <richardcoch...@gmail.com> Reported-by: Daniel Bristot de Oliveira <bris...@redhat.com> Reported-by: Prarit Bhargava <pra...@redhat.com> Signed-off-by: John Stultz <john.stu...@linaro.org> Cc: Richard Cochran <richardcoch...@gmail.com> Cc: Jan Kara <j...@suse.cz> Cc: Jiri Bohac <jbo...@suse.cz> Cc: Shuah Khan <shua...@osg.samsung.com> Cc: Ingo Molnar <mi...@kernel.org> Link: http://lkml.kernel.org/r/1434063297-28657-4-git-send-email-john.stu...@linaro.org Signed-off-by: Thomas Gleixner <t...@linutronix.de> [Yadi: Move do_adjtimex to timekeeping.c and solve context issues] Signed-off-by: Hu <yadi...@windriver.com> Signed-off-by: Zefan Li <lize...@huawei.com> commit d91a2aa46cbc95c9854d4a444fc6acee444ca655 Author: Eric Dumazet <eduma...@google.com> Date: Sun Jul 10 10:04:02 2016 +0200 tcp: make challenge acks less predictable commit 75ff39ccc1bd5d3c455b6822ab09e533c551f758 upstream. Yue Cao claims that current host rate limiting of challenge ACKS (RFC 5961) could leak enough information to allow a patient attacker to hijack TCP sessions. He will soon provide details in an academic paper. This patch increases the default limit from 100 to 1000, and adds some randomization so that the attacker can no longer hijack sessions without spending a considerable amount of probes. Based on initial analysis and patch from Linus. Note that we also have per socket rate limiting, so it is tempting to remove the host limit in the future. v2: randomize the count of challenge acks per second, not the period. Fixes: 282f23c6ee34 ("tcp: implement RFC 5961 3.2") Reported-by: Yue Cao <ycao...@ucr.edu> Signed-off-by: Eric Dumazet <eduma...@google.com> Suggested-by: Linus Torvalds <torva...@linux-foundation.org> Cc: Yuchung Cheng <ych...@google.com> Cc: Neal Cardwell <ncardw...@google.com> Acked-by: Neal Cardwell <ncardw...@google.com> Acked-by: Yuchung Cheng <ych...@google.com> Signed-off-by: David S. Miller <da...@davemloft.net> [lizf: Backported to 3.4: - adjust context - use ACCESS_ONCE instead WRITE_ONCE/READ_ONCE - open-code prandom_u32_max()] Signed-off-by: Zefan Li <lize...@huawei.com> commit 00e9ff5931fe385b9e24e6a49fdfb1ae763984e6 Author: Zefan Li <lize...@huawei.com> Date: Sun Oct 9 19:23:12 2016 +0800 Revert "USB: Add OTG PET device to TPL" This reverts commit 97fa724b23c3dd22e9c0979ad0e9d260cc6d545d. Conflicts: drivers/usb/core/quirks.c Signed-off-by: Zefan Li <lize...@huawei.com> commit 7862b8a351bb72b45307123993b2991374869765 Author: Zefan Li <lize...@huawei.com> Date: Sun Oct 9 19:20:47 2016 +0800 Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" This reverts commit eea5a87d270e8d6925063019c3b0f3ff61fcb49a. Conflicts: drivers/usb/core/quirks.c include/linux/usb/quirks.h Signed-off-by: Zefan Li <lize...@huawei.com> commit d64519bf05760fc4f2d9a31e28df56af873c5b65 Author: Zefan Li <lize...@huawei.com> Date: Sun Oct 9 19:06:49 2016 +0800 Fix incomplete backport of commit 0f792cf949a0 Signed-off-by: Zefan Li <lize...@huawei.com> commit 6883832be845e54570388a791140be16a0f26a71 Author: Zefan Li <lize...@huawei.com> Date: Sun Oct 9 19:00:59 2016 +0800 Fix incomplete backport of commit 423f04d63cf4 Signed-off-by: Zefan Li <lize...@huawei.com> commit af706acbb5dbf492ad19fb448c2f05db8595f78e Author: Nicolas Dichtel <nicolas.dich...@6wind.com> Date: Wed Sep 5 02:12:42 2012 +0000 ipv6: fix handling of blackhole and prohibit routes commit ef2c7d7b59708d54213c7556a82d14de9a7e4475 upstream. When adding a blackhole or a prohibit route, they were handling like classic routes. Moreover, it was only possible to add this kind of routes by specifying an interface. Bug already reported here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498498 Before the patch: $ ip route add blackhole 2001::1/128 RTNETLINK answers: No such device $ ip route add blackhole 2001::1/128 dev eth0 $ ip -6 route | grep 2001 2001::1 dev eth0 metric 1024 After: $ ip route add blackhole 2001::1/128 $ ip -6 route | grep 2001 blackhole 2001::1 dev lo metric 1024 error -22 v2: wrong patch v3: add a field fc_type in struct fib6_config to store RTN_* type Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> diff --git a/Makefile b/Makefile index c63e183..564196d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 4 -SUBLEVEL = 112 +SUBLEVEL = 113 EXTRAVERSION = NAME = Saber-toothed Squirrel diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h b/arch/arm/mach-pxa/include/mach/pxa27x.h index 7cff640..66c4cbf 100644 --- a/arch/arm/mach-pxa/include/mach/pxa27x.h +++ b/arch/arm/mach-pxa/include/mach/pxa27x.h @@ -21,7 +21,7 @@ extern void __init pxa27x_map_io(void); extern void __init pxa27x_init_irq(void); -extern int __init pxa27x_set_pwrmode(unsigned int mode); +extern int pxa27x_set_pwrmode(unsigned int mode); extern void pxa27x_cpu_pm_enter(suspend_state_t state); #define pxa27x_handle_irq ichp_handle_irq diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index a2fe795..f7c9978 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -242,7 +242,7 @@ static struct clk_lookup pxa27x_clkregs[] = { */ static unsigned int pwrmode = PWRMODE_SLEEP; -int __init pxa27x_set_pwrmode(unsigned int mode) +int pxa27x_set_pwrmode(unsigned int mode) { switch (mode) { case PWRMODE_SLEEP: diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index fb489cc..74c3e53 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -94,7 +94,7 @@ ENDPROC(cpu_v7_dcache_clean_area) .equ cpu_v7_suspend_size, 4 * 8 #ifdef CONFIG_ARM_CPU_SUSPEND ENTRY(cpu_v7_do_suspend) - stmfd sp!, {r4 - r10, lr} + stmfd sp!, {r4 - r11, lr} mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID mrc p15, 0, r5, c13, c0, 3 @ User r/o thread ID stmia r0!, {r4 - r5} @@ -105,7 +105,7 @@ ENTRY(cpu_v7_do_suspend) mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control stmia r0, {r6 - r11} - ldmfd sp!, {r4 - r10, pc} + ldmfd sp!, {r4 - r11, pc} ENDPROC(cpu_v7_do_suspend) ENTRY(cpu_v7_do_resume) diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 3f4c5cb..939a6b7 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h @@ -679,7 +679,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) * @u: ...unless v is equal to u. * * Atomically adds @a to @v, so long as it was not @u. - * Returns the old value of @v. + * Returns true iff @v was not @u. */ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) { diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 12c1ed3..c626855 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -468,6 +468,55 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, return 1; } +/* + * Check how the syscall number gets loaded into %r20 within + * the delay branch in userspace and adjust as needed. + */ + +static void check_syscallno_in_delay_branch(struct pt_regs *regs) +{ + u32 opcode, source_reg; + u32 __user *uaddr; + int err; + + /* Usually we don't have to restore %r20 (the system call number) + * because it gets loaded in the delay slot of the branch external + * instruction via the ldi instruction. + * In some cases a register-to-register copy instruction might have + * been used instead, in which case we need to copy the syscall + * number into the source register before returning to userspace. + */ + + /* A syscall is just a branch, so all we have to do is fiddle the + * return pointer so that the ble instruction gets executed again. + */ + regs->gr[31] -= 8; /* delayed branching */ + + /* Get assembler opcode of code in delay branch */ + uaddr = (unsigned int *) ((regs->gr[31] & ~3) + 4); + err = get_user(opcode, uaddr); + if (err) + return; + + /* Check if delay branch uses "ldi int,%r20" */ + if ((opcode & 0xffff0000) == 0x34140000) + return; /* everything ok, just return */ + + /* Check if delay branch uses "nop" */ + if (opcode == INSN_NOP) + return; + + /* Check if delay branch uses "copy %rX,%r20" */ + if ((opcode & 0xffe0ffff) == 0x08000254) { + source_reg = (opcode >> 16) & 31; + regs->gr[source_reg] = regs->gr[20]; + return; + } + + pr_warn("syscall restart: %s (pid %d): unexpected opcode 0x%08x\n", + current->comm, task_pid_nr(current), opcode); +} + static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) { @@ -489,10 +538,7 @@ syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) } /* fallthrough */ case -ERESTARTNOINTR: - /* A syscall is just a branch, so all - * we have to do is fiddle the return pointer. - */ - regs->gr[31] -= 8; /* delayed branching */ + check_syscallno_in_delay_branch(regs); /* Preserve original r28. */ regs->gr[28] = regs->orig_r28; break; @@ -543,18 +589,9 @@ insert_restart_trampoline(struct pt_regs *regs) } case -ERESTARTNOHAND: case -ERESTARTSYS: - case -ERESTARTNOINTR: { - /* Hooray for delayed branching. We don't - * have to restore %r20 (the system call - * number) because it gets loaded in the delay - * slot of the branch external instruction. - */ - regs->gr[31] -= 8; - /* Preserve original r28. */ - regs->gr[28] = regs->orig_r28; - + case -ERESTARTNOINTR: + check_syscallno_in_delay_branch(regs); return; - } default: break; } diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 40f4eb3..59d0eac 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -45,6 +45,9 @@ L3_START_KERNEL = pud_index(__START_KERNEL_map) .globl startup_64 startup_64: + /* Sanitize CPU configuration */ + call verify_cpu + /* * At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 1, * and someone has loaded an identity mapped page table @@ -160,6 +163,9 @@ ENTRY(secondary_startup_64) * after the boot processor executes this code. */ + /* Sanitize CPU configuration */ + call verify_cpu + /* Enable PAE mode and PGE */ movl $(X86_CR4_PAE | X86_CR4_PGE), %eax movq %rax, %cr4 @@ -253,6 +259,8 @@ ENTRY(secondary_startup_64) pushq %rax # target address in negative space lretq +#include "verify_cpu.S" + /* SMP bootup changes these two */ __REFDATA .align 8 diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 115eac4..b2952ca 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -748,12 +748,15 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, return 0; } -#ifdef CONFIG_X86_32 -#define NR_restart_syscall __NR_restart_syscall -#else /* !CONFIG_X86_32 */ -#define NR_restart_syscall \ - test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall -#endif /* CONFIG_X86_32 */ +static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) +{ +#if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64) + return __NR_restart_syscall; +#else /* !CONFIG_X86_32 && CONFIG_X86_64 */ + return test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : + __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); +#endif /* CONFIG_X86_32 || !CONFIG_X86_64 */ +} /* * Note that 'init' is a special process: it doesn't get signals it doesn't @@ -795,7 +798,7 @@ static void do_signal(struct pt_regs *regs) break; case -ERESTART_RESTARTBLOCK: - regs->ax = NR_restart_syscall; + regs->ax = get_nr_restart_syscall(regs); regs->ip -= 2; break; } diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S index b9242ba..4cf401f 100644 --- a/arch/x86/kernel/verify_cpu.S +++ b/arch/x86/kernel/verify_cpu.S @@ -34,10 +34,11 @@ #include <asm/msr-index.h> verify_cpu: - pushfl # Save caller passed flags - pushl $0 # Kill any dangerous flags - popfl + pushf # Save caller passed flags + push $0 # Kill any dangerous flags + popf +#ifndef __x86_64__ pushfl # standard way to check for cpuid popl %eax movl %eax,%ebx @@ -48,6 +49,7 @@ verify_cpu: popl %eax cmpl %eax,%ebx jz verify_cpu_no_longmode # cpu has no cpuid +#endif movl $0x0,%eax # See if cpuid 1 is implemented cpuid @@ -130,10 +132,10 @@ verify_cpu_sse_test: jmp verify_cpu_sse_test # try again verify_cpu_no_longmode: - popfl # Restore caller passed flags + popf # Restore caller passed flags movl $1,%eax ret verify_cpu_sse_ok: - popfl # Restore caller passed flags + popf # Restore caller passed flags xorl %eax, %eax ret diff --git a/block/partitions/mac.c b/block/partitions/mac.c index 11f688b..f51c930 100644 --- a/block/partitions/mac.c +++ b/block/partitions/mac.c @@ -32,7 +32,7 @@ int mac_partition(struct parsed_partitions *state) Sector sect; unsigned char *data; int slot, blocks_in_map; - unsigned secsize; + unsigned secsize, datasize, partoffset; #ifdef CONFIG_PPC_PMAC int found_root = 0; int found_root_goodness = 0; @@ -50,10 +50,14 @@ int mac_partition(struct parsed_partitions *state) } secsize = be16_to_cpu(md->block_size); put_dev_sector(sect); - data = read_part_sector(state, secsize/512, §); + datasize = round_down(secsize, 512); + data = read_part_sector(state, datasize / 512, §); if (!data) return -1; - part = (struct mac_partition *) (data + secsize%512); + partoffset = secsize % 512; + if (partoffset + sizeof(*part) > datasize) + return -1; + part = (struct mac_partition *) (data + partoffset); if (be16_to_cpu(part->signature) != MAC_PARTITION_MAGIC) { put_dev_sector(sect); return 0; /* not a MacOS disk */ diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 4a9c499..1ef1428 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -280,12 +280,12 @@ static int ablkcipher_walk_first(struct ablkcipher_request *req, if (WARN_ON_ONCE(in_irq())) return -EDEADLK; + walk->iv = req->info; walk->nbytes = walk->total; if (unlikely(!walk->total)) return 0; walk->iv_buffer = NULL; - walk->iv = req->info; if (unlikely(((unsigned long)walk->iv & alignmask))) { int err = ablkcipher_copy_iv(walk, tfm, alignmask); if (err) diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 8502462..a68b56a 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -192,9 +192,14 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags) struct sock *sk2; struct alg_sock *ask2; struct hash_ctx *ctx2; + bool more; int err; - err = crypto_ahash_export(req, state); + lock_sock(sk); + more = ctx->more; + err = more ? crypto_ahash_export(req, state) : 0; + release_sock(sk); + if (err) return err; @@ -205,7 +210,10 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags) sk2 = newsock->sk; ask2 = alg_sk(sk2); ctx2 = ask2->private; - ctx2->more = 1; + ctx2->more = more; + + if (!more) + return err; err = crypto_ahash_import(&ctx2->req, state); if (err) { diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 0a1ebea..34e5d65 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -329,12 +329,12 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc, if (WARN_ON_ONCE(in_irq())) return -EDEADLK; + walk->iv = desc->info; walk->nbytes = walk->total; if (unlikely(!walk->total)) return 0; walk->buffer = NULL; - walk->iv = desc->info; if (unlikely(((unsigned long)walk->iv & alignmask))) { int err = blkcipher_copy_iv(walk, tfm, alignmask); if (err) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index f48720c..2788c15 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -85,6 +85,7 @@ static void *acpi_irq_context; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; struct workqueue_struct *kacpi_hotplug_wq; +unsigned int acpi_sci_irq = INVALID_ACPI_IRQ; EXPORT_SYMBOL(kacpi_hotplug_wq); /* @@ -612,17 +613,19 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, acpi_irq_handler = NULL; return AE_NOT_ACQUIRED; } + acpi_sci_irq = irq; return AE_OK; } -acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler) +acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler handler) { - if (irq != acpi_gbl_FADT.sci_interrupt) + if (gsi != acpi_gbl_FADT.sci_interrupt || !acpi_sci_irq_valid()) return AE_BAD_PARAMETER; - free_irq(irq, acpi_irq); + free_irq(acpi_sci_irq, acpi_irq); acpi_irq_handler = NULL; + acpi_sci_irq = INVALID_ACPI_IRQ; return AE_OK; } diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 30cdba7..1f0db2c 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1228,6 +1228,15 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, ata_tf_to_fis(tf, pmp, is_cmd, fis); ahci_fill_cmd_slot(pp, 0, cmd_fis_len | flags | (pmp << 12)); + /* set port value for softreset of Port Multiplier */ + if (pp->fbs_enabled && pp->fbs_last_dev != pmp) { + tmp = readl(port_mmio + PORT_FBS); + tmp &= ~(PORT_FBS_DEV_MASK | PORT_FBS_DEC); + tmp |= pmp << PORT_FBS_DEV_OFFSET; + writel(tmp, port_mmio + PORT_FBS); + pp->fbs_last_dev = pmp; + } + /* issue & wait */ writel(1, port_mmio + PORT_CMD_ISSUE); diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 0c4ed89..7f0c7f0 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c @@ -631,6 +631,9 @@ static void sil_dev_config(struct ata_device *dev) unsigned int n, quirks = 0; unsigned char model_num[ATA_ID_PROD_LEN + 1]; + /* This controller doesn't support trim */ + dev->horkage |= ATA_HORKAGE_NOTRIM; + ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); for (n = 0; sil_blacklist[n].product; n++) diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 933adc5..47e5b65 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -256,8 +256,8 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst, struct blkif_x86_32_request *src) { int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST; - dst->operation = src->operation; - switch (src->operation) { + dst->operation = ACCESS_ONCE(src->operation); + switch (dst->operation) { case BLKIF_OP_READ: case BLKIF_OP_WRITE: case BLKIF_OP_WRITE_BARRIER: @@ -292,8 +292,8 @@ static inline void blkif_get_x86_64_req(struct blkif_request *dst, struct blkif_x86_64_request *src) { int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST; - dst->operation = src->operation; - switch (src->operation) { + dst->operation = ACCESS_ONCE(src->operation); + switch (dst->operation) { case BLKIF_OP_READ: case BLKIF_OP_WRITE: case BLKIF_OP_WRITE_BARRIER: diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 4b8e03f..8ff6f5c 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c @@ -94,6 +94,7 @@ static struct usb_device_id ath3k_table[] = { { USB_DEVICE(0x0CF3, 0x311D) }, { USB_DEVICE(0x0cf3, 0x3121) }, { USB_DEVICE(0x0CF3, 0x817a) }, + { USB_DEVICE(0x0CF3, 0x817b) }, { USB_DEVICE(0x0cf3, 0xe003) }, { USB_DEVICE(0x0CF3, 0xE004) }, { USB_DEVICE(0x0CF3, 0xE005) }, @@ -144,6 +145,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0CF3, 0x817b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index bbd1e6c..2302075 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -172,6 +172,7 @@ static struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x0cf3, 0x817b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index c1de4c3..4eedb07 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -3620,6 +3620,11 @@ static int __devinit pci_probe(struct pci_dev *dev, reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, ~0); ohci->it_context_support = reg_read(ohci, OHCI1394_IsoXmitIntMaskSet); + /* JMicron JMB38x often shows 0 at first read, just ignore it */ + if (!ohci->it_context_support) { + dev_notice(&dev->dev, "overriding IsoXmitIntMask\n"); + ohci->it_context_support = 0xf; + } reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, ~0); ohci->it_context_mask = ohci->it_context_support; ohci->n_it = hweight32(ohci->it_context_mask); diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 77c456d..afd1cc1 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -51,6 +51,11 @@ static void radeon_hotplug_work_func(struct work_struct *work) struct drm_mode_config *mode_config = &dev->mode_config; struct drm_connector *connector; + /* we can race here at startup, some boards seem to trigger + * hotplug irqs when they shouldn't. */ + if (!rdev->mode_info.mode_config_initialized) + return; + mutex_lock(&mode_config->mutex); if (mode_config->num_connector) { list_for_each_entry(connector, &mode_config->connector_list, head) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 111d956..6a46d6e 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -381,8 +381,10 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible) set_current_state(interruptible ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); - if (signal_pending(current)) { - rc = -EINTR; + if (interruptible && signal_pending(current)) { + __set_current_state(TASK_RUNNING); + remove_wait_queue(&vga_wait_queue, &wait); + rc = -ERESTARTSYS; break; } schedule(); diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 75fa2e7..b8ad132 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1301,7 +1301,7 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) "Multi-Axis Controller" }; const char *type, *bus; - char buf[64]; + char buf[64] = ""; unsigned int i; int len; int ret; diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index bd400f2..99e4974 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -3586,10 +3586,15 @@ found: for (bus = dev->bus; bus; bus = bus->parent) { struct pci_dev *bridge = bus->self; - if (!bridge || !pci_is_pcie(bridge) || + /* If it's an integrated device, allow ATS */ + if (!bridge) + return 1; + /* Connected via non-PCIe: no ATS */ + if (!pci_is_pcie(bridge) || bridge->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) return 0; + /* If we found the root port, look it up in the ATSR */ if (bridge->pcie_type == PCI_EXP_TYPE_ROOT_PORT) { for (i = 0; i < atsru->devices_cnt; i++) if (atsru->devices[i] == bridge) diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index 6f3fd4c..3911991 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c @@ -371,19 +371,12 @@ static void gigaset_freecshw(struct cardstate *cs) tasklet_kill(&cs->write_tasklet); if (!cs->hw.ser) return; - dev_set_drvdata(&cs->hw.ser->dev.dev, NULL); platform_device_unregister(&cs->hw.ser->dev); - kfree(cs->hw.ser); - cs->hw.ser = NULL; } static void gigaset_device_release(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - - /* adapted from platform_device_release() in drivers/base/platform.c */ - kfree(dev->platform_data); - kfree(pdev->resource); + kfree(container_of(dev, struct ser_cardstate, dev.dev)); } /* @@ -412,7 +405,6 @@ static int gigaset_initcshw(struct cardstate *cs) cs->hw.ser = NULL; return 0; } - dev_set_drvdata(&cs->hw.ser->dev.dev, cs); tasklet_init(&cs->write_tasklet, gigaset_modem_fill, (unsigned long) cs); diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 884369f..c0b787b 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -1156,7 +1156,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) if (ipac->type & IPAC_TYPE_IPACX) { ista = ReadIPAC(ipac, ISACX_ISTA); - while (ista && cnt--) { + while (ista && --cnt) { pr_debug("%s: ISTA %02x\n", ipac->name, ista); if (ista & IPACX__ICA) ipac_irq(&ipac->hscx[0], ista); @@ -1168,7 +1168,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) } } else if (ipac->type & IPAC_TYPE_IPAC) { ista = ReadIPAC(ipac, IPAC_ISTA); - while (ista && cnt--) { + while (ista && --cnt) { pr_debug("%s: ISTA %02x\n", ipac->name, ista); if (ista & (IPAC__ICD | IPAC__EXD)) { istad = ReadISAC(isac, ISAC_ISTA); @@ -1186,7 +1186,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) ista = ReadIPAC(ipac, IPAC_ISTA); } } else if (ipac->type & IPAC_TYPE_HSCX) { - while (cnt) { + while (--cnt) { ista = ReadIPAC(ipac, IPAC_ISTAB + ipac->hscx[1].off); pr_debug("%s: B2 ISTA %02x\n", ipac->name, ista); if (ista) @@ -1197,7 +1197,6 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) mISDNisac_irq(isac, istad); if (0 == (ista | istad)) break; - cnt--; } } if (cnt > maxloop) /* only for ISAC/HSCX without PCI IRQ test */ diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d5fc3ec..a0b28ee 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1553,11 +1553,8 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, /* * Only pass ioctls through if the device sizes match exactly. */ - if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) { - int err = scsi_verify_blk_ioctl(NULL, cmd); - if (err) - r = err; - } + if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) + r = scsi_verify_blk_ioctl(NULL, cmd); return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg); } diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index be86d59..c948acf 100644 --- a/drivers/md/persistent-data/dm-btree.c +++ b/drivers/md/persistent-data/dm-btree.c @@ -230,6 +230,16 @@ static void pop_frame(struct del_stack *s) dm_tm_unlock(s->tm, f->b); } +static void unlock_all_frames(struct del_stack *s) +{ + struct frame *f; + + while (unprocessed_frames(s)) { + f = s->spine + s->top--; + dm_tm_unlock(s->tm, f->b); + } +} + int dm_btree_del(struct dm_btree_info *info, dm_block_t root) { int r; @@ -285,9 +295,13 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root) f->current_child = f->nr_children; } } - out: + if (r) { + /* cleanup all frames of del_stack */ + unlock_all_frames(s); + } kfree(s); + return r; } EXPORT_SYMBOL_GPL(dm_btree_del); @@ -450,8 +464,10 @@ static int btree_split_sibling(struct shadow_spine *s, dm_block_t root, r = insert_at(sizeof(__le64), pn, parent_index + 1, le64_to_cpu(rn->keys[0]), &location); - if (r) + if (r) { + unlock_block(s->info, right); return r; + } if (key < le64_to_cpu(rn->keys[0])) { unlock_block(s->info, right); diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a548eed..a4d994f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1272,11 +1272,8 @@ static void error(struct mddev *mddev, struct md_rdev *rdev) set_bit(Blocked, &rdev->flags); spin_lock_irqsave(&conf->device_lock, flags); if (test_and_clear_bit(In_sync, &rdev->flags)) { - unsigned long flags; - spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded++; set_bit(Faulty, &rdev->flags); - spin_unlock_irqrestore(&conf->device_lock, flags); /* * if recovery is running, make sure it aborts. */ diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index bf24aa7..1c96f3d 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -632,8 +632,10 @@ int add_mtd_partitions(struct mtd_info *master, for (i = 0; i < nbparts; i++) { slave = allocate_partition(master, parts + i, i, cur_offset); - if (IS_ERR(slave)) + if (IS_ERR(slave)) { + del_mtd_partitions(master); return PTR_ERR(slave); + } mutex_lock(&mtd_partitions_mutex); list_add(&slave->list, &mtd_partitions); diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 2d3ad72..1824486 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -177,6 +177,9 @@ static void sja1000_start(struct net_device *dev) priv->write_reg(priv, REG_RXERR, 0x0); priv->read_reg(priv, REG_ECC); + /* clear interrupt flags */ + priv->read_reg(priv, REG_IR); + /* leave reset mode */ set_normal_mode(dev); } diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 16caeba..53f5a96 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1513,8 +1513,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) txdesc = &mdp->tx_ring[entry]; /* soft swap. */ if (!mdp->cd->hw_swap) - sh_eth_soft_swap(phys_to_virt(ALIGN(txdesc->addr, 4)), - skb->len + 2); + sh_eth_soft_swap(PTR_ALIGN(skb->data, 4), skb->len + 2); txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len, DMA_TO_DEVICE); if (skb->len < ETHERSMALL) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 6749acf..e735239 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -173,6 +173,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN); if (!skb) return RX_HANDLER_CONSUMED; + *pskb = skb; eth = eth_hdr(skb); src = macvlan_hash_lookup(port, eth->h_source); if (!src) @@ -222,6 +223,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) if (!skb) goto out; + *pskb = skb; skb->dev = dev; skb->pkt_type = PACKET_HOST; diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 60338ff..5b45369 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -933,7 +933,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = { { PHY_ID_BCM5421, 0xfffffff0 }, { PHY_ID_BCM5461, 0xfffffff0 }, { PHY_ID_BCM5464, 0xfffffff0 }, - { PHY_ID_BCM5482, 0xfffffff0 }, + { PHY_ID_BCM5481, 0xfffffff0 }, { PHY_ID_BCM5482, 0xfffffff0 }, { PHY_ID_BCM50610, 0xfffffff0 }, { PHY_ID_BCM50610M, 0xfffffff0 }, diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index d7a65e1..dadf085 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c @@ -546,16 +546,12 @@ static void x25_asy_receive_buf(struct tty_struct *tty, static int x25_asy_open_tty(struct tty_struct *tty) { - struct x25_asy *sl = tty->disc_data; + struct x25_asy *sl; int err; if (tty->ops->write == NULL) return -EOPNOTSUPP; - /* First make sure we're not already connected. */ - if (sl && sl->magic == X25_ASY_MAGIC) - return -EEXIST; - /* OK. Find a free X.25 channel to use. */ sl = x25_asy_alloc(); if (sl == NULL) diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c index 1a84507..e24ef9a 100644 --- a/drivers/net/wireless/mwifiex/debugfs.c +++ b/drivers/net/wireless/mwifiex/debugfs.c @@ -621,7 +621,7 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf, (struct mwifiex_private *) file->private_data; unsigned long addr = get_zeroed_page(GFP_KERNEL); char *buf = (char *) addr; - int pos = 0, ret = 0, i; + int pos, ret, i; u8 value[MAX_EEPROM_DATA]; if (!buf) @@ -629,7 +629,7 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf, if (saved_offset == -1) { /* No command has been given */ - pos += snprintf(buf, PAGE_SIZE, "0"); + pos = snprintf(buf, PAGE_SIZE, "0"); goto done; } @@ -638,17 +638,17 @@ mwifiex_rdeeprom_read(struct file *file, char __user *ubuf, (u16) saved_bytes, value); if (ret) { ret = -EINVAL; - goto done; + goto out_free; } - pos += snprintf(buf, PAGE_SIZE, "%d %d ", saved_offset, saved_bytes); + pos = snprintf(buf, PAGE_SIZE, "%d %d ", saved_offset, saved_bytes); for (i = 0; i < saved_bytes; i++) - pos += snprintf(buf + strlen(buf), PAGE_SIZE, "%d ", value[i]); - - ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos); + pos += scnprintf(buf + pos, PAGE_SIZE - pos, "%d ", value[i]); done: + ret = simple_read_from_buffer(ubuf, count, ppos, buf, pos); +out_free: free_page(addr); return ret; } diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index cd4966b..37bcc56 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -398,17 +398,17 @@ static struct netbk_rx_meta *get_next_rx_buffer(struct xenvif *vif, struct netrx_pending_operations *npo) { struct netbk_rx_meta *meta; - struct xen_netif_rx_request *req; + struct xen_netif_rx_request req; - req = RING_GET_REQUEST(&vif->rx, vif->rx.req_cons++); + RING_COPY_REQUEST(&vif->rx, vif->rx.req_cons++, &req); meta = npo->meta + npo->meta_prod++; meta->gso_size = 0; meta->size = 0; - meta->id = req->id; + meta->id = req.id; npo->copy_off = 0; - npo->copy_gref = req->gref; + npo->copy_gref = req.gref; return meta; } @@ -510,7 +510,7 @@ static int netbk_gop_skb(struct sk_buff *skb, struct xenvif *vif = netdev_priv(skb->dev); int nr_frags = skb_shinfo(skb)->nr_frags; int i; - struct xen_netif_rx_request *req; + struct xen_netif_rx_request req; struct netbk_rx_meta *meta; unsigned char *data; int head = 1; @@ -520,14 +520,14 @@ static int netbk_gop_skb(struct sk_buff *skb, /* Set up a GSO prefix descriptor, if necessary */ if (skb_shinfo(skb)->gso_size && vif->gso_prefix) { - req = RING_GET_REQUEST(&vif->rx, vif->rx.req_cons++); + RING_COPY_REQUEST(&vif->rx, vif->rx.req_cons++, &req); meta = npo->meta + npo->meta_prod++; meta->gso_size = skb_shinfo(skb)->gso_size; meta->size = 0; - meta->id = req->id; + meta->id = req.id; } - req = RING_GET_REQUEST(&vif->rx, vif->rx.req_cons++); + RING_COPY_REQUEST(&vif->rx, vif->rx.req_cons++, &req); meta = npo->meta + npo->meta_prod++; if (!vif->gso_prefix) @@ -536,9 +536,9 @@ static int netbk_gop_skb(struct sk_buff *skb, meta->gso_size = 0; meta->size = 0; - meta->id = req->id; + meta->id = req.id; npo->copy_off = 0; - npo->copy_gref = req->gref; + npo->copy_gref = req.gref; data = skb->data; while (data < skb_tail_pointer(skb)) { @@ -856,9 +856,7 @@ static void tx_add_credit(struct xenvif *vif) * Allow a burst big enough to transmit a jumbo packet of up to 128kB. * Otherwise the interface can seize up due to insufficient credit. */ - max_burst = RING_GET_REQUEST(&vif->tx, vif->tx.req_cons)->size; - max_burst = min(max_burst, 131072UL); - max_burst = max(max_burst, vif->credit_bytes); + max_burst = max(131072UL, vif->credit_bytes); /* Take care that adding a new chunk of credit doesn't wrap to zero. */ max_credit = vif->remaining_credit + vif->credit_bytes; @@ -884,7 +882,7 @@ static void netbk_tx_err(struct xenvif *vif, make_tx_response(vif, txp, XEN_NETIF_RSP_ERROR); if (cons == end) break; - txp = RING_GET_REQUEST(&vif->tx, cons++); + RING_COPY_REQUEST(&vif->tx, cons++, txp); } while (1); vif->tx.req_cons = cons; xen_netbk_check_rx_xenvif(vif); @@ -945,8 +943,7 @@ static int netbk_count_requests(struct xenvif *vif, drop_err = -E2BIG; } - memcpy(txp, RING_GET_REQUEST(&vif->tx, cons + slots), - sizeof(*txp)); + RING_COPY_REQUEST(&vif->tx, cons + slots, txp); /* If the guest submitted a frame >= 64 KiB then * first->size overflowed and following slots will @@ -1228,8 +1225,7 @@ static int xen_netbk_get_extras(struct xenvif *vif, return -EBADR; } - memcpy(&extra, RING_GET_REQUEST(&vif->tx, cons), - sizeof(extra)); + RING_COPY_REQUEST(&vif->tx, cons, &extra); if (unlikely(!extra.type || extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) { vif->tx.req_cons = ++cons; @@ -1424,7 +1420,7 @@ static unsigned xen_netbk_tx_build_gops(struct xen_netbk *netbk) idx = vif->tx.req_cons; rmb(); /* Ensure that we see the request before we copy it. */ - memcpy(&txreq, RING_GET_REQUEST(&vif->tx, idx), sizeof(txreq)); + RING_COPY_REQUEST(&vif->tx, idx, &txreq); /* Credit-based scheduling. */ if (txreq.size > vif->remaining_credit && diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h index 8c33491..c6aa388 100644 --- a/drivers/parisc/iommu-helpers.h +++ b/drivers/parisc/iommu-helpers.h @@ -104,7 +104,11 @@ iommu_coalesce_chunks(struct ioc *ioc, struct device *dev, struct scatterlist *contig_sg; /* contig chunk head */
_______________________________________________ unionfs-cvs mailing list: http://unionfs.filesystems.org/ unionfs-cvs@fsl.cs.sunysb.edu http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs