GIT: wrapfs-3.12.y -- Wrapfs: update copyright year to 2015 (push to branch refs/heads/master)

ezk at fsl.cs.sunysb.edu ezk at fsl.cs.sunysb.edu
Sun Dec 13 18:42:10 EST 2015


Push to branch refs/heads/master:
5569c504dd16a9bbee354612d721eafb1de17392 -->
  a702e1f21d594312f5788332487dadefaf71fe92

 Documentation/filesystems/00-INDEX                 |   2 +
 Documentation/filesystems/wrapfs.txt               | 172 ++++++
 MAINTAINERS                                        |   9 +
 Makefile                                           |   2 +-
 arch/arm/plat-orion/common.c                       |   2 +-
 arch/arm64/kernel/stacktrace.c                     |   6 +-
 arch/powerpc/include/asm/lppaca.h                  |  12 +-
 arch/powerpc/kernel/rtas.c                         |   3 +
 arch/x86/include/asm/pgtable_64.h                  |   3 +-
 arch/x86/include/uapi/asm/kvm.h                    |   3 +
 arch/x86/include/uapi/asm/svm.h                    |   1 +
 arch/x86/kvm/emulate.c                             |  10 +-
 arch/x86/kvm/svm.c                                 |  22 +-
 arch/x86/kvm/vmx.c                                 |   5 +-
 arch/x86/mm/fault.c                                |   2 +-
 arch/x86/mm/init_64.c                              |  36 +-
 crypto/ablkcipher.c                                |   2 +-
 crypto/algapi.c                                    |   2 +-
 crypto/api.c                                       |   6 +-
 crypto/crypto_user.c                               |   2 +-
 drivers/ata/ahci.c                                 | 109 +++-
 drivers/ata/ahci.h                                 |   6 +
 drivers/ata/libahci.c                              |  26 +-
 drivers/ata/sata_highbank.c                        |   3 +-
 drivers/block/rbd.c                                |  67 ++-
 drivers/block/xen-blkfront.c                       |   3 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c              |   5 +-
 drivers/infiniband/core/cm.c                       |  10 +-
 drivers/iommu/amd_iommu.c                          |   4 +-
 drivers/iommu/amd_iommu_types.h                    |   1 +
 drivers/md/persistent-data/dm-btree-remove.c       |  17 +-
 drivers/md/persistent-data/dm-btree.c              |   2 +-
 drivers/md/raid1.c                                 |   2 +-
 drivers/md/raid10.c                                |   2 +-
 drivers/message/fusion/mptctl.c                    |   9 +
 drivers/mfd/wm5110-tables.c                        |  44 +-
 drivers/net/ethernet/allwinner/sun4i-emac.c        |   6 +-
 drivers/net/ethernet/apple/macmace.c               |   1 +
 drivers/net/ethernet/mellanox/mlx4/cmd.c           |   2 +-
 drivers/net/ethernet/mellanox/mlx4/eq.c            |   2 +-
 drivers/net/ethernet/realtek/r8169.c               |  27 +-
 drivers/net/ethernet/sfc/selftest.c                |   2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |   7 +-
 drivers/net/macvtap.c                              |   2 +-
 drivers/net/ppp/pppoe.c                            |   2 +-
 drivers/net/usb/qmi_wwan.c                         |   5 +-
 drivers/net/virtio_net.c                           |   4 +-
 drivers/net/wireless/iwlwifi/dvm/lib.c             |   2 +-
 drivers/net/wireless/iwlwifi/iwl-7000.c            |   2 +-
 drivers/net/wireless/iwlwifi/mvm/d3.c              |  12 +-
 drivers/power/bq24190_charger.c                    |   2 +-
 drivers/scsi/mvsas/mv_sas.c                        |   2 +
 drivers/spi/spi-gpio.c                             |   2 +-
 drivers/tty/serial/8250/8250_dw.c                  |  10 +-
 drivers/tty/serial/8250/8250_pci.c                 |  46 +-
 drivers/usb/host/xhci-pci.c                        |   1 +
 drivers/usb/host/xhci-ring.c                       |  20 +-
 fs/Kconfig                                         |   1 +
 fs/Makefile                                        |   1 +
 fs/ceph/mds_client.c                               |  11 +-
 fs/wrapfs/Kconfig                                  |   8 +
 fs/wrapfs/Makefile                                 |   7 +
 fs/wrapfs/dentry.c                                 |  49 ++
 fs/wrapfs/file.c                                   | 378 +++++++++++++
 fs/wrapfs/inode.c                                  | 591 +++++++++++++++++++++
 fs/wrapfs/lookup.c                                 | 332 ++++++++++++
 fs/wrapfs/main.c                                   | 174 ++++++
 fs/wrapfs/mmap.c                                   |  94 ++++
 fs/wrapfs/super.c                                  | 168 ++++++
 fs/wrapfs/wrapfs.h                                 | 207 ++++++++
 include/linux/namei.h                              |   2 +
 include/net/inet_common.h                          |   3 +-
 include/sound/wm8904.h                             |   2 +-
 include/uapi/linux/magic.h                         |   2 +
 kernel/auditsc.c                                   |  49 +-
 kernel/module.c                                    |   8 +-
 mm/filemap.c                                       |   9 +-
 net/bridge/br_netfilter.c                          |   4 +-
 net/core/dst.c                                     |   2 +-
 net/ipv4/ipmr.c                                    |   6 +-
 net/ipv6/addrconf.c                                |  17 +-
 net/ipv6/sit.c                                     |  20 +-
 net/irda/irlmp.c                                   |   2 +-
 net/netfilter/xt_NFQUEUE.c                         |   7 +-
 net/rds/connection.c                               |   6 +
 net/rds/tcp_recv.c                                 |  11 +-
 net/socket.c                                       |   3 +
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c            |  12 +-
 net/sunrpc/xprtrdma/svc_rdma_sendto.c              |   1 +
 security/keys/gc.c                                 |  10 +-
 90 files changed, 2767 insertions(+), 201 deletions(-)

commit a702e1f21d594312f5788332487dadefaf71fe92
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Nov 3 23:53:56 2015 -0500

    Wrapfs: update copyright year to 2015

commit 1e7bd249cd98b0995a8e50e056d001d9d820e697
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Nov 3 23:53:56 2015 -0500

    Wrapfs: use vfs xattr helpers
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 52089abf725ab9ffe2fb0df855218100a0e1f75e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Aug 15 23:00:54 2014 -0400

    Wrapfs: properly copy meta-data after AIO operations from lower inode
    
    Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 6695d35f696314b320ddf4426b882b1e5218e22e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Aug 11 18:34:18 2014 -0400

    Wrapfs: leave placeholders for updating upper inode after AIO
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit ac1fdfd2d0ab70dac3b9b7efb483f473af131446
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Sun Aug 10 01:25:04 2014 -0400

    Wrapfs: protect lower_file by ref-count during aio operation
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
    Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>

commit 6638497890824c2822af856ed12a6868f98b9a75
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Wed Jun 25 22:51:34 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 <ezk at cs.sunysb.edu>
    Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>

commit 235020fe0554beb7ae88dbed3b0c6c74ff5c3ec8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Wed Jun 25 22:50:34 2014 -0400

     Wrapfs: support extended attributes (xattr) operations
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
    Signed-off-by: Mengyang Li <li.mengyang at stonybrook.edu>

commit e0c60b6f2f40c7e38cd42f4ad79bebbee09283ea
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Jun 20 20:08:50 2014 -0400

    Wrapfs: support asynchronous-IO (AIO) operations
    
    Signed-off-by: Li Mengyang <li.mengyang at stonybrook.edu>
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 84669591fdc636f3aac35e3ca30077e56609cdd2
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Jun 20 20:08:50 2014 -0400

    Wrapfs: support direct-IO (DIO) operations
    
    Signed-off-by: Li Mengyang <li.mengyang at stonybrook.edu>
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit fa02d3e8534391adcecee464588f0269894d510a
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu May 15 00:16:01 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 <ezk at cs.sunysb.edu>

commit 29dd2d7efbe5f4fa41dd78d33fec3d0138b07038
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu Apr 3 14:19:17 2014 -0400

    Wrapfs: update documentation
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 8252d56d2887e818e33373bda379ca05eb5cfe1c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu Apr 3 14:19:14 2014 -0400

    Wrapfs: update maintainers
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 00fa65dfb46461f02a31f9d04dc312588a5561c2
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jan 21 03:33:20 2014 -0500

    Wrapfs: update documentation
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 97b8cddd5b410467bd85a95a24658fba01021d3e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jan 21 01:24:13 2014 -0500

    Wrapfs: 2014 Copyright update
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit d7f2ee5619af49e5ca3aa7c27064707a3819e248
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Nov 19 19:16:01 2013 -0500

    patch wrapfs-copyright-update.patch

commit 988915fce2a402f33f6ff22dd47a621aa5c2ada9
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Nov 18 23:25:14 2013 -0500

    Wrapfs: implement ->getattr
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit a25525deb64667a8c214c8618069a2d536eb6ac5
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Nov 18 20:34:00 2013 -0500

    Wrapfs: use file_inode helper
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit e248697035cb49b55cb66e1578c9c3749f1c086c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Nov 18 20:34:00 2013 -0500

    Wrapfs: call filemap_write_and_wait in ->flush
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 8c0649b062e3faff5a750061a0011f32c5ac154f
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Sun Nov 17 22:14:19 2013 -0500

    VFS: export vfs_path_lookup
    
    In 3.12, this useful function was unexported: wrapfs needs a way to lookup
    relative to a struct path and use a proper vfsmount, unlike lookup_one_len.
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit ba368978953515c6a447aadd20fe158081d1c386
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Sun Nov 17 19:36:14 2013 -0500

    Wrapfs: ->readdir op now ->iterate
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 844d4d53d5cafd334ad8513cdca1dcc79a92f7da
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Wed Jun 5 01:36:58 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 <ezk at cs.sunysb.edu>

commit 7b897c159eb8e78ba624cb03881d1ffd9eec6d32
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Wed Jun 5 01:36:58 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 <ezk at cs.sunysb.edu>

commit c27a1a59233340ee86811ee48821bca191e0e13e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:32 2013 -0400

    Wrapfs: declare MODULE_ALIAS_FS
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 45b3bf6c129046cd5b1b6ef9c6b87b3b4c597e45
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:32 2013 -0400

    Wrapfs: don't use FS_REVAL_DOT in fs_flags
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 26d3f8d8fd4cb27d9f45cbc11d24a08929e58e9e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:31 2013 -0400

    Wrapfs: remove dependency on now-defunct CONFIG_EXPERIMENTAL
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 0feb6348094729ddd4b5e282db86100b73668e7e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:31 2013 -0400

    Wrapfs: dentry_open() no longer does mntput/dput
    
    We need to grab a reference on the path before dentry_open, and drop it
    after.
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 19febe804f9f699d3b786c276a0e88a4b7809c86
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:30 2013 -0400

    Wrapfs: no need to call mnt_want_write any longer
    
    Apparently this is now being done by the VFS.
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 3d4c80f3f63a278e5f1b449501e2a51bd3972762
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:30 2013 -0400

    Wrapfs: remove VM_CAN_NONLINEAR flag use in ->mmap
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 5f29cd1e17ce80d5ecab2124a3f6529370c19bb0
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:29 2013 -0400

    Wrapfs: ->lookup takes flags not a nameidata
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 3a22bc5a11afb25d1ddd91dde6fe54b097721b99
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:29 2013 -0400

    Wrapfs: ->create no longer takes a nameidata, only a flag
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit ebac5e9e7eaaa4de38e4fb869d79768842129105
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:29 2013 -0400

    Wrapfs: ->d_revalidate now takes namei flags, not nameidata
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 945637c191b05cf9084146257188399d59c4ab77
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:28 2013 -0400

    Wrapfs: struct nameidata no longer has an open-intent data
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 40a575e74bb3242eaef30d3ad8aca489ee313af4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:28 2013 -0400

    Wrapfs: dentry_open now takes a struct path
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit a2d4aef80069f335728deafc8d63d19fa2e2311c
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:27 2013 -0400

    Wrapfs: use vm_munmap in ->mmap
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 99e5bd3f73e3603eb689734528c56b5a585655f3
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:27 2013 -0400

    Wrapfs: use clear_inode in evict_inode
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit de1a18346d43b738ecf02d4d83764b65bd4dbd96
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jun 4 23:19:26 2013 -0400

    Wrapfs: use d_make_root
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit b98e3074ee73e9b0728dc062d653c79142992358
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Jan 31 04:40:19 2012 -0500

    Wrapfs: use mode_t
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit fd033c9396ebf2a832f288261cf81f587b970873
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Sun Jan 29 20:34:27 2012 -0500

    Wrapfs: use set_nlink()
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 6e4aaa76df2139d57f2ba7ee443ec453d33cf04c
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 6c37c6183e26a64231898c6b0f40c68149c6bd6b
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:32 2011 -0400

    Wrapfs: use d_alloc_root
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 4c68ac998f016fda4ab09a03a2e5c29108956172
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:31 2011 -0400

    Wrapfs: use d_set_d_op
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 8cd66b9cbdcb0fdae045a503009f9b8db1e2c735
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:30 2011 -0400

    Wrapfs: use updated vfs_path_lookup prototype
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 5c4217d2f366d10eb69279405e12d26b6bea2b53
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:30 2011 -0400

    Wrapfs: ->fsync updates for new prototype
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 8a5668bd412335ccb00f7e3b7f4470b58f0cc564
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:29 2011 -0400

    Wrapfs: support LOOKUP_RCU in ->d_revalidate
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 99a1dff11020c3c6a99a108cda25ef87d7b7c606
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Sep 6 00:10:28 2011 -0400

    Wrapfs: new ->permission prototype and fixes.
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 5a35cd2215c5a90c5e40f5e50a22eb3d6b992b3f
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit c85dbf89a2ba51a6cf3c3a0a9064e92758c4bea7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Mar 18 13:14:28 2011 -0400

    Wrapfs: remove extra debug in rmdir
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit b9fd87ada6f38227d6f0359b76bb153dfaf0bdeb
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Mar 18 12:38:01 2011 -0400

    Wrapfs: checkpatch fixes
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit fa5a03dd126fa099f073fb0d7ef911bfde0976f7
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit d273f4d3f196d56e7d99ff20f6a40a0d163234e4
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Thu Mar 17 23:21:55 2011 -0400

    Wrapfs: copyright update for 2011
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit bcd487e4afe2c0b5382e612983460b8cb50dcefc
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 549062d6a13d2eec19f2e9cc1ed8a3cb7c15d0c6
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 592778d94336fc843e07af822b9bd69eae520dd3
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 6518faf0047f246151a43dda134e3f8607e1493f
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 3d3827bcae75a9287b0eb37c862aaf890180ad85
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 6bd204676b29369d7a42225426b97c4a3bcb10a8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Nov 12 18:15:05 2010 -0500

    Wrapfs: handle maxbytes properly
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 2741db9b2a3267e78f5bd8eaf5aa08196850a58d
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit dbc5d360439bb30df03dc1801b75918e59c66a3d
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit e93d5885aa317a8083c1a59f3d303a9e351ac7d7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Aug 6 23:37:29 2010 -0400

    Wrapfs: update ->fsync prototype
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit c4e15c0b11e494009a04ae7eec97d4e2894f4a02
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Apr 20 21:22:02 2010 -0400

    Wrapfs: update documentation
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 42d2b72fe361a57120bf9d9d2597ad0745e1a203
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Tue Apr 20 15:32:09 2010 -0400

    Wrapfs: include slab.h
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit fe0739470490113667542b6bcdbea578c1c2c84e
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 5e8c01d122bf374ae4a392302b70bdfb03ff48ba
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit ed7d95328233d9fbc1a9ecd024ce8bac38a255f3
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 761f9bbf11d2ca1304e69144e996f206d3e1e5d8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Kconfig: hook to configure Wrapfs
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit ef42651c38723bb0ad2c4f867d6bf7f1b8d2b93d
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Makefile: hook to compile Wrapfs
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 379faa82914129c339957c70165c54ea17555ba8
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: file system magic number
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 7657122d5d6cc5f89cd862f2167fa4ad0a54990a
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: Kconfig options
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 025cb37f8920d6da0f0e47579483a7f8b6923815
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: main Makefile
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 4d1d20ca33102de65f62a8fcc78fce6a6c3cbca2
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 47a5471e76a3543fbd1b12ab5c3ce0da7ab8f964
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: mount-time and module-linkage functions
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 6b24d80b4e47f8ab62e2482d29c374acc873ca61
Author: Erez Zadok <ezk at 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 <ezk at cs.sunysb.edu>

commit 761578b1948cbd38baf099d1dc632d0d9cd97f54
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: file operations
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 4b233f4dbb4e2ee20771885cf4c1d5475fb33d23
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: dentry operations
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 35acab2eb0cb11206c6cfc608b8718699e6c3b9e
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: inode operations
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 8917339983eb65f2bccbe3af6f8548a9f4d8cbba
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: superblock operations
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit c07bb44946ea164836aacd2b3900fd690716cc29
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: main header file
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 29d3974f95f818a200058b689ea399fcdcba20c7
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: Maintainers
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 587b1bcedfa1ce0545154aa798e6a9256f6318bd
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Documentation: index entry for Wrapfs
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit b4be5c500eef90c3a2b2138af72ec5c4308c46ea
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Mon Jan 4 20:45:06 2010 -0500

    Wrapfs: introduction and usage documentation
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

commit 90592c1e43aaea1d02ef309a00e9215f30624dd6
Author: Jiri Slaby <jslaby at suse.cz>
Date:   Mon Nov 23 14:04:07 2015 +0100

    Linux 3.12.51

commit 5f2f951264d00b7abbba4ce95ead10d5ff25c0da
Author: Yasuaki Ishimatsu <isimatu.yasuaki at jp.fujitsu.com>
Date:   Fri Aug 22 13:27:34 2014 -0700

    x86/mm/hotplug: Modify PGD entry when removing memory
    
    commit 9661d5bcd058fe15b4138a00d96bd36516134543 upstream.
    
    When hot-adding/removing memory, sync_global_pgds() is called
    for synchronizing PGD to PGD entries of all processes MM.  But
    when hot-removing memory, sync_global_pgds() does not work
    correctly.
    
    At first, sync_global_pgds() checks whether target PGD is none
    or not.  And if PGD is none, the PGD is skipped.  But when
    hot-removing memory, PGD may be none since PGD may be cleared by
    free_pud_table().  So when sync_global_pgds() is called after
    hot-removing memory, sync_global_pgds() should not skip PGD even
    if the PGD is none.  And sync_global_pgds() must clear PGD
    entries of all processes MM.
    
    Currently sync_global_pgds() does not clear PGD entries of all
    processes MM when hot-removing memory.  So when hot adding
    memory which is same memory range as removed memory after
    hot-removing memory, following call traces are shown:
    
     kernel BUG at arch/x86/mm/init_64.c:206!
     ...
     [<ffffffff815e0c80>] kernel_physical_mapping_init+0x1b2/0x1d2
     [<ffffffff815ced94>] init_memory_mapping+0x1d4/0x380
     [<ffffffff8104aebd>] arch_add_memory+0x3d/0xd0
     [<ffffffff815d03d9>] add_memory+0xb9/0x1b0
     [<ffffffff81352415>] acpi_memory_device_add+0x1af/0x28e
     [<ffffffff81325dc4>] acpi_bus_device_attach+0x8c/0xf0
     [<ffffffff813413b9>] acpi_ns_walk_namespace+0xc8/0x17f
     [<ffffffff81325d38>] ? acpi_bus_type_and_status+0xb7/0xb7
     [<ffffffff81325d38>] ? acpi_bus_type_and_status+0xb7/0xb7
     [<ffffffff813418ed>] acpi_walk_namespace+0x95/0xc5
     [<ffffffff81326b4c>] acpi_bus_scan+0x9a/0xc2
     [<ffffffff81326bff>] acpi_scan_bus_device_check+0x8b/0x12e
     [<ffffffff81326cb5>] acpi_scan_device_check+0x13/0x15
     [<ffffffff81320122>] acpi_os_execute_deferred+0x25/0x32
     [<ffffffff8107e02b>] process_one_work+0x17b/0x460
     [<ffffffff8107edfb>] worker_thread+0x11b/0x400
     [<ffffffff8107ece0>] ? rescuer_thread+0x400/0x400
     [<ffffffff81085aef>] kthread+0xcf/0xe0
     [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
     [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0
     [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
    
    This patch clears PGD entries of all processes MM when
    sync_global_pgds() is called after hot-removing memory
    
    Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki at jp.fujitsu.com>
    Acked-by: Toshi Kani <toshi.kani at hp.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Cc: Tang Chen <tangchen at cn.fujitsu.com>
    Cc: Gu Zheng <guz.fnst at cn.fujitsu.com>
    Cc: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
    Cc: Linus Torvalds <torvalds at linux-foundation.org>
    Signed-off-by: Ingo Molnar <mingo at kernel.org>
    Cc: Vlastimil Babka <vbabka at suse.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 3434ce3d38e41b0c46c932b1b06913cb42197f9c
Author: Yasuaki Ishimatsu <isimatu.yasuaki at jp.fujitsu.com>
Date:   Fri Aug 22 13:27:31 2014 -0700

    x86/mm/hotplug: Pass sync_global_pgds() a correct argument in remove_pagetable()
    
    commit 5255e0a79fcc0ff47b387af92bd9ef5729b1b859 upstream.
    
    When hot-adding memory after hot-removing memory, following call
    traces are shown:
    
      kernel BUG at arch/x86/mm/init_64.c:206!
      ...
     [<ffffffff815e0c80>] kernel_physical_mapping_init+0x1b2/0x1d2
     [<ffffffff815ced94>] init_memory_mapping+0x1d4/0x380
     [<ffffffff8104aebd>] arch_add_memory+0x3d/0xd0
     [<ffffffff815d03d9>] add_memory+0xb9/0x1b0
     [<ffffffff81352415>] acpi_memory_device_add+0x1af/0x28e
     [<ffffffff81325dc4>] acpi_bus_device_attach+0x8c/0xf0
     [<ffffffff813413b9>] acpi_ns_walk_namespace+0xc8/0x17f
     [<ffffffff81325d38>] ? acpi_bus_type_and_status+0xb7/0xb7
     [<ffffffff81325d38>] ? acpi_bus_type_and_status+0xb7/0xb7
     [<ffffffff813418ed>] acpi_walk_namespace+0x95/0xc5
     [<ffffffff81326b4c>] acpi_bus_scan+0x9a/0xc2
     [<ffffffff81326bff>] acpi_scan_bus_device_check+0x8b/0x12e
     [<ffffffff81326cb5>] acpi_scan_device_check+0x13/0x15
     [<ffffffff81320122>] acpi_os_execute_deferred+0x25/0x32
     [<ffffffff8107e02b>] process_one_work+0x17b/0x460
     [<ffffffff8107edfb>] worker_thread+0x11b/0x400
     [<ffffffff8107ece0>] ? rescuer_thread+0x400/0x400
     [<ffffffff81085aef>] kthread+0xcf/0xe0
     [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
     [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0
     [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
    
    The patch-set fixes the issue.
    
    This patch (of 2):
    
    remove_pagetable() gets start argument and passes the argument
    to sync_global_pgds().  In this case, the argument must not be
    modified.  If the argument is modified and passed to
    sync_global_pgds(), sync_global_pgds() does not correctly
    synchronize PGD to PGD entries of all processes MM since
    synchronized range of memory [start, end] is wrong.
    
    Unfortunately the start argument is modified in
    remove_pagetable().  So this patch fixes the issue.
    
    Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki at jp.fujitsu.com>
    Acked-by: Toshi Kani <toshi.kani at hp.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Cc: Tang Chen <tangchen at cn.fujitsu.com>
    Cc: Gu Zheng <guz.fnst at cn.fujitsu.com>
    Cc: Zhang Yanfei <zhangyanfei at cn.fujitsu.com>
    Cc: Linus Torvalds <torvalds at linux-foundation.org>
    Signed-off-by: Ingo Molnar <mingo at kernel.org>
    Cc: Vlastimil Babka <vbabka at suse.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 49f9add06964fe16997aa34099e7bb31c39b0314
Author: Marcelo Leitner <mleitner at redhat.com>
Date:   Mon Feb 23 11:17:13 2015 -0300

    ipv6: addrconf: validate new MTU before applying it
    
    commit 77751427a1ff25b27d47a4c36b12c3c8667855ac upstream.
    
    Currently we don't check if the new MTU is valid or not and this allows
    one to configure a smaller than minimum allowed by RFCs or even bigger
    than interface own MTU, which is a problem as it may lead to packet
    drops.
    
    If you have a daemon like NetworkManager running, this may be exploited
    by remote attackers by forging RA packets with an invalid MTU, possibly
    leading to a DoS. (NetworkManager currently only validates for values
    too small, but not for too big ones.)
    
    The fix is just to make sure the new value is valid. That is, between
    IPV6_MIN_MTU and interface's MTU.
    
    Note that similar check is already performed at
    ndisc_router_discovery(), for when kernel itself parses the RA.
    
    Signed-off-by: Marcelo Ricardo Leitner <mleitner at redhat.com>
    Signed-off-by: Sabrina Dubroca <sd at queasysnail.net>
    Signed-off-by: David S. Miller <davem at davemloft.net>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 2b27106cd93020563185ea94618ea5019308226b
Author: Nadav Amit <namit at cs.technion.ac.il>
Date:   Thu Sep 18 22:39:40 2014 +0300

    KVM: x86: Use new is_noncanonical_address in _linearize
    
    commit 4be4de7ef9fd3a4d77320d4713970299ffecd286 upstream.
    
    Replace the current canonical address check with the new function which is
    identical.
    
    Signed-off-by: Nadav Amit <namit at cs.technion.ac.il>
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit e4bcfa44c82cb5bcfb44a4722c80686096c2e181
Author: Nadav Amit <namit at cs.technion.ac.il>
Date:   Tue Oct 28 00:03:43 2014 +0200

    KVM: x86: Fix far-jump to non-canonical check
    
    commit 7e46dddd6f6cd5dbf3c7bd04a7e75d19475ac9f2 upstream.
    
    Commit d1442d85cc30 ("KVM: x86: Handle errors when RIP is set during far
    jumps") introduced a bug that caused the fix to be incomplete.  Due to
    incorrect evaluation, far jump to segment with L bit cleared (i.e., 32-bit
    segment) and RIP with any of the high bits set (i.e, RIP[63:32] != 0) set may
    not trigger #GP.  As we know, this imposes a security problem.
    
    In addition, the condition for two warnings was incorrect.
    
    Fixes: d1442d85cc30ea75f7d399474ca738e0bc96f715
    Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
    Signed-off-by: Nadav Amit <namit at cs.technion.ac.il>
    [Add #ifdef CONFIG_X86_64 to avoid complaints of undefined behavior. - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 4c6a0e0edfe824edd777a496f46817b4fb465cbd
Author: Paolo Bonzini <pbonzini at redhat.com>
Date:   Tue Nov 10 09:14:39 2015 +0100

    KVM: svm: unconditionally intercept #DB
    
    commit cbdb967af3d54993f5814f1cee0ed311a055377d upstream.
    
    This is needed to avoid the possibility that the guest triggers
    an infinite stream of #DB exceptions (CVE-2015-8104).
    
    VMX is not affected: because it does not save DR6 in the VMCS,
    it already intercepts #DB unconditionally.
    
    Reported-by: Jan Beulich <jbeulich at suse.com>
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 0ccaee7be83eb288e8baacf6eebd4d8b8593f462
Author: Eric Northup <digitaleric at google.com>
Date:   Tue Nov 3 18:03:53 2015 +0100

    KVM: x86: work around infinite loop in microcode when #AC is delivered
    
    commit 54a20552e1eae07aa240fa370a0293e006b5faed upstream.
    
    It was found that a guest can DoS a host by triggering an infinite
    stream of "alignment check" (#AC) exceptions.  This causes the
    microcode to enter an infinite loop where the core never receives
    another interrupt.  The host kernel panics pretty quickly due to the
    effects (CVE-2015-5307).
    
    Signed-off-by: Eric Northup <digitaleric at google.com>
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit 97a51976c67e9dd841026a60f200f41c292fce37
Author: Nadav Amit <namit at cs.technion.ac.il>
Date:   Mon Jul 21 14:37:24 2014 +0300

    KVM: x86: Defining missing x86 vectors
    
    commit c9cdd085bb75226879fd468b88e2e7eb467325b7 upstream.
    
    Defining XE, XM and VE vector numbers.
    
    Signed-off-by: Nadav Amit <namit at cs.technion.ac.il>
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit bd6e04696299ce030e8650a96151fe383c431dce
Author: David Howells <dhowells at redhat.com>
Date:   Thu Oct 15 17:21:37 2015 +0100

    KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring
    
    commit f05819df10d7b09f6d1eb6f8534a8f68e5a4fe61 upstream.
    
    The following sequence of commands:
    
        i=`keyctl add user a a @s`
        keyctl request2 keyring foo bar @t
        keyctl unlink $i @s
    
    tries to invoke an upcall to instantiate a keyring if one doesn't already
    exist by that name within the user's keyring set.  However, if the upcall
    fails, the code sets keyring->type_data.reject_error to -ENOKEY or some
    other error code.  When the key is garbage collected, the key destroy
    function is called unconditionally and keyring_destroy() uses list_empty()
    on keyring->type_data.link - which is in a union with reject_error.
    Subsequently, the kernel tries to unlink the keyring from the keyring names
    list - which oopses like this:
    
    	BUG: unable to handle kernel paging request at 00000000ffffff8a
    	IP: [<ffffffff8126e051>] keyring_destroy+0x3d/0x88
    	...
    	Workqueue: events key_garbage_collector
    	...
    	RIP: 0010:[<ffffffff8126e051>] keyring_destroy+0x3d/0x88
    	RSP: 0018:ffff88003e2f3d30  EFLAGS: 00010203
    	RAX: 00000000ffffff82 RBX: ffff88003bf1a900 RCX: 0000000000000000
    	RDX: 0000000000000000 RSI: 000000003bfc6901 RDI: ffffffff81a73a40
    	RBP: ffff88003e2f3d38 R08: 0000000000000152 R09: 0000000000000000
    	R10: ffff88003e2f3c18 R11: 000000000000865b R12: ffff88003bf1a900
    	R13: 0000000000000000 R14: ffff88003bf1a908 R15: ffff88003e2f4000
    	...
    	CR2: 00000000ffffff8a CR3: 000000003e3ec000 CR4: 00000000000006f0
    	...
    	Call Trace:
    	 [<ffffffff8126c756>] key_gc_unused_keys.constprop.1+0x5d/0x10f
    	 [<ffffffff8126ca71>] key_garbage_collector+0x1fa/0x351
    	 [<ffffffff8105ec9b>] process_one_work+0x28e/0x547
    	 [<ffffffff8105fd17>] worker_thread+0x26e/0x361
    	 [<ffffffff8105faa9>] ? rescuer_thread+0x2a8/0x2a8
    	 [<ffffffff810648ad>] kthread+0xf3/0xfb
    	 [<ffffffff810647ba>] ? kthread_create_on_node+0x1c2/0x1c2
    	 [<ffffffff815f2ccf>] ret_from_fork+0x3f/0x70
    	 [<ffffffff810647ba>] ? kthread_create_on_node+0x1c2/0x1c2
    
    Note the value in RAX.  This is a 32-bit representation of -ENOKEY.
    
    The solution is to only call ->destroy() if the key was successfully
    instantiated.
    
    Reported-by: Dmitry Vyukov <dvyukov at google.com>
    Signed-off-by: David Howells <dhowells at redhat.com>
    Tested-by: Dmitry Vyukov <dvyukov at google.com>
    Signed-off-by: Jiri Slaby <jslaby at suse.cz>

commit f4562591c143cc272eab0d95be01dcca528627b9
Author: David Howells <dhowells at redhat.com>
Date:   Fri Sep 25 16:30:08 2015 +0100

diff --git a/Makefile b/Makefile
index cbb29f4..4dc1525 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 12
-SUBLEVEL = 50
+SUBLEVEL = 51
 EXTRAVERSION =
 NAME = One Giant Leap for Frogkind
 
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index c66d163..b1e00f3 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -498,7 +498,7 @@ void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
 
 	d->netdev = &orion_ge00.dev;
 	for (i = 0; i < d->nr_chips; i++)
-		d->chip[i].mii_bus = &orion_ge00_shared.dev;
+		d->chip[i].mii_bus = &orion_ge_mvmdio.dev;
 	orion_switch_device.dev.platform_data = d;
 
 	platform_device_register(&orion_switch_device);
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 048334b..d25459f 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -48,11 +48,7 @@ int unwind_frame(struct stackframe *frame)
 
 	frame->sp = fp + 0x10;
 	frame->fp = *(unsigned long *)(fp);
-	/*
-	 * -4 here because we care about the PC at time of bl,
-	 * not where the return will go.
-	 */
-	frame->pc = *(unsigned long *)(fp + 8) - 4;
+	frame->pc = *(unsigned long *)(fp + 8);
 
 	return 0;
 }
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index 4470d1e..844c28d 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -84,8 +84,8 @@ struct lppaca {
 	 * the processor is yielded (either because of an OS yield or a
 	 * hypervisor preempt).  An even value implies that the processor is
 	 * currently executing.
-	 * NOTE: This value will ALWAYS be zero for dedicated processors and
-	 * will NEVER be zero for shared processors (ie, initialized to a 1).
+	 * NOTE: Even dedicated processor partitions can yield so this
+	 * field cannot be used to determine if we are shared or dedicated.
 	 */
 	volatile __be32 yield_count;
 	volatile __be32 dispersion_count; /* dispatch changed physical cpu */
@@ -106,15 +106,15 @@ extern struct lppaca lppaca[];
 #define lppaca_of(cpu)	(*paca[cpu].lppaca_ptr)
 
 /*
- * Old kernels used a reserved bit in the VPA to determine if it was running
- * in shared processor mode. New kernels look for a non zero yield count
- * but KVM still needs to set the bit to keep the old stuff happy.
+ * We are using a non architected field to determine if a partition is
+ * shared or dedicated. This currently works on both KVM and PHYP, but
+ * we will have to transition to something better.
  */
 #define LPPACA_OLD_SHARED_PROC		2
 
 static inline bool lppaca_shared_proc(struct lppaca *l)
 {
-	return l->yield_count != 0;
+	return !!(l->__old_status & LPPACA_OLD_SHARED_PROC);
 }
 
 /*
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index c4bc8d6..e6b028d 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1041,6 +1041,9 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
+	if (!rtas.entry)
+		return -EINVAL;
+
 	if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
 		return -EFAULT;
 
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index e22c1db..60ac4a1 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -115,7 +115,8 @@ static inline void native_pgd_clear(pgd_t *pgd)
 	native_set_pgd(pgd, native_make_pgd(0));
 }
 
-extern void sync_global_pgds(unsigned long start, unsigned long end);
+extern void sync_global_pgds(unsigned long start, unsigned long end,
+			     int removed);
 
 /*
  * Conversion functions: convert a page and protection to a page entry,
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 5d9a303..53077f9 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -23,7 +23,10 @@
 #define GP_VECTOR 13
 #define PF_VECTOR 14
 #define MF_VECTOR 16
+#define AC_VECTOR 17
 #define MC_VECTOR 18
+#define XM_VECTOR 19
+#define VE_VECTOR 20
 
 /* Select x86 specific features in <linux/kvm.h> */
 #define __KVM_HAVE_PIT
diff --git a/arch/x86/include/uapi/asm/svm.h b/arch/x86/include/uapi/asm/svm.h
index b5d7640..8a4add8 100644
--- a/arch/x86/include/uapi/asm/svm.h
+++ b/arch/x86/include/uapi/asm/svm.h
@@ -100,6 +100,7 @@
 	{ SVM_EXIT_EXCP_BASE + UD_VECTOR,       "UD excp" }, \
 	{ SVM_EXIT_EXCP_BASE + PF_VECTOR,       "PF excp" }, \
 	{ SVM_EXIT_EXCP_BASE + NM_VECTOR,       "NM excp" }, \
+	{ SVM_EXIT_EXCP_BASE + AC_VECTOR,       "AC excp" }, \
 	{ SVM_EXIT_EXCP_BASE + MC_VECTOR,       "MC excp" }, \
 	{ SVM_EXIT_INTR,        "interrupt" }, \
 	{ SVM_EXIT_NMI,         "nmi" }, \
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 8216f48..cad86cd 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -582,12 +582,14 @@ static inline int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst,
 	case 4:
 		ctxt->_eip = (u32)dst;
 		break;
+#ifdef CONFIG_X86_64
 	case 8:
 		if ((cs_l && is_noncanonical_address(dst)) ||
-		    (!cs_l && (dst & ~(u32)-1)))
+		    (!cs_l && (dst >> 32) != 0))
 			return emulate_gp(ctxt, 0);
 		ctxt->_eip = dst;
 		break;
+#endif
 	default:
 		WARN(1, "unsupported eip assignment size\n");
 	}
@@ -662,7 +664,7 @@ static int __linearize(struct x86_emulate_ctxt *ctxt,
 	la = seg_base(ctxt, addr.seg) + addr.ea;
 	switch (ctxt->mode) {
 	case X86EMUL_MODE_PROT64:
-		if (((signed long)la << 16) >> 16 != la)
+		if (is_noncanonical_address(la))
 			return emulate_gp(ctxt, 0);
 		break;
 	default:
@@ -2000,7 +2002,7 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt)
 
 	rc = assign_eip_far(ctxt, ctxt->src.val, new_desc.l);
 	if (rc != X86EMUL_CONTINUE) {
-		WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
+		WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64);
 		/* assigning eip failed; restore the old cs */
 		ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS);
 		return rc;
@@ -2084,7 +2086,7 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
 		return rc;
 	rc = assign_eip_far(ctxt, eip, new_desc.l);
 	if (rc != X86EMUL_CONTINUE) {
-		WARN_ON(!ctxt->mode != X86EMUL_MODE_PROT64);
+		WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64);
 		ops->set_segment(ctxt, old_cs, &old_desc, 0, VCPU_SREG_CS);
 	}
 	return rc;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index d1a065e..28989732 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1103,6 +1103,8 @@ static void init_vmcb(struct vcpu_svm *svm)
 	set_exception_intercept(svm, PF_VECTOR);
 	set_exception_intercept(svm, UD_VECTOR);
 	set_exception_intercept(svm, MC_VECTOR);
+	set_exception_intercept(svm, AC_VECTOR);
+	set_exception_intercept(svm, DB_VECTOR);
 
 	set_intercept(svm, INTERCEPT_INTR);
 	set_intercept(svm, INTERCEPT_NMI);
@@ -1639,20 +1641,13 @@ static void svm_set_segment(struct kvm_vcpu *vcpu,
 	mark_dirty(svm->vmcb, VMCB_SEG);
 }
 
-static void update_db_bp_intercept(struct kvm_vcpu *vcpu)
+static void update_bp_intercept(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
 
-	clr_exception_intercept(svm, DB_VECTOR);
 	clr_exception_intercept(svm, BP_VECTOR);
 
-	if (svm->nmi_singlestep)
-		set_exception_intercept(svm, DB_VECTOR);
-
 	if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) {
-		if (vcpu->guest_debug &
-		    (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))
-			set_exception_intercept(svm, DB_VECTOR);
 		if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
 			set_exception_intercept(svm, BP_VECTOR);
 	} else
@@ -1730,7 +1725,6 @@ static int db_interception(struct vcpu_svm *svm)
 		if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP))
 			svm->vmcb->save.rflags &=
 				~(X86_EFLAGS_TF | X86_EFLAGS_RF);
-		update_db_bp_intercept(&svm->vcpu);
 	}
 
 	if (svm->vcpu.guest_debug &
@@ -1765,6 +1759,12 @@ static int ud_interception(struct vcpu_svm *svm)
 	return 1;
 }
 
+static int ac_interception(struct vcpu_svm *svm)
+{
+	kvm_queue_exception_e(&svm->vcpu, AC_VECTOR, 0);
+	return 1;
+}
+
 static void svm_fpu_activate(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
@@ -3285,6 +3285,7 @@ static int (*const svm_exit_handlers[])(struct vcpu_svm *svm) = {
 	[SVM_EXIT_EXCP_BASE + PF_VECTOR]	= pf_interception,
 	[SVM_EXIT_EXCP_BASE + NM_VECTOR]	= nm_interception,
 	[SVM_EXIT_EXCP_BASE + MC_VECTOR]	= mc_interception,
+	[SVM_EXIT_EXCP_BASE + AC_VECTOR]	= ac_interception,
 	[SVM_EXIT_INTR]				= intr_interception,
 	[SVM_EXIT_NMI]				= nmi_interception,
 	[SVM_EXIT_SMI]				= nop_on_interception,
@@ -3673,7 +3674,6 @@ static int enable_nmi_window(struct kvm_vcpu *vcpu)
 	 */
 	svm->nmi_singlestep = true;
 	svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF);
-	update_db_bp_intercept(vcpu);
 	return 0;
 }
 
@@ -4275,7 +4275,7 @@ static struct kvm_x86_ops svm_x86_ops = {
 	.vcpu_load = svm_vcpu_load,
 	.vcpu_put = svm_vcpu_put,
 
-	.update_db_bp_intercept = update_db_bp_intercept,
+	.update_db_bp_intercept = update_bp_intercept,
 	.get_msr = svm_get_msr,
 	.set_msr = svm_set_msr,
 	.get_segment_base = svm_get_segment_base,
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f5ddacc..53fede6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1388,7 +1388,7 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)
 	u32 eb;
 
 	eb = (1u << PF_VECTOR) | (1u << UD_VECTOR) | (1u << MC_VECTOR) |
-	     (1u << NM_VECTOR) | (1u << DB_VECTOR);
+	     (1u << NM_VECTOR) | (1u << DB_VECTOR) | (1u << AC_VECTOR);
 	if ((vcpu->guest_debug &
 	     (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP)) ==
 	    (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP))
@@ -4812,6 +4812,9 @@ static int handle_exception(struct kvm_vcpu *vcpu)
 		return handle_rmode_exception(vcpu, ex_no, error_code);
 
 	switch (ex_no) {
+	case AC_VECTOR:
+		kvm_queue_exception_e(vcpu, AC_VECTOR, error_code);
+		return 1;
 	case DB_VECTOR:
 		dr6 = vmcs_readl(EXIT_QUALIFICATION);
 		if (!(vcpu->guest_debug &
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 814a25d..43df028 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -345,7 +345,7 @@ out:
 
 void vmalloc_sync_all(void)
 {
-	sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END);
+	sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END, 0);
 }
 
 /*
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index a93e327..d7735ce 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -178,7 +178,7 @@ __setup("noexec32=", nonx32_setup);
  * When memory was added/removed make sure all the processes MM have
  * suitable PGD entries in the local PGD level page.
  */
-void sync_global_pgds(unsigned long start, unsigned long end)
+void sync_global_pgds(unsigned long start, unsigned long end, int removed)
 {
 	unsigned long address;
 
@@ -186,7 +186,12 @@ void sync_global_pgds(unsigned long start, unsigned long end)
 		const pgd_t *pgd_ref = pgd_offset_k(address);
 		struct page *page;
 
-		if (pgd_none(*pgd_ref))
+		/*
+		 * When it is called after memory hot remove, pgd_none()
+		 * returns true. In this case (removed == 1), we must clear
+		 * the PGD entries in the local PGD level page.
+		 */
+		if (pgd_none(*pgd_ref) && !removed)
 			continue;
 
 		spin_lock(&pgd_lock);
@@ -199,12 +204,18 @@ void sync_global_pgds(unsigned long start, unsigned long end)
 			pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
 			spin_lock(pgt_lock);
 
-			if (pgd_none(*pgd))
-				set_pgd(pgd, *pgd_ref);
-			else
+			if (!pgd_none(*pgd_ref) && !pgd_none(*pgd))
 				BUG_ON(pgd_page_vaddr(*pgd)
 				       != pgd_page_vaddr(*pgd_ref));
 
+			if (removed) {
+				if (pgd_none(*pgd_ref) && !pgd_none(*pgd))
+					pgd_clear(pgd);
+			} else {
+				if (pgd_none(*pgd))
+					set_pgd(pgd, *pgd_ref);
+			}
+
 			spin_unlock(pgt_lock);
 		}
 		spin_unlock(&pgd_lock);
@@ -633,7 +644,7 @@ kernel_physical_mapping_init(unsigned long start,
 	}
 
 	if (pgd_changed)
-		sync_global_pgds(addr, end - 1);
+		sync_global_pgds(addr, end - 1, 0);
 
 	__flush_tlb_all();
 
@@ -975,25 +986,26 @@ static void __meminit
 remove_pagetable(unsigned long start, unsigned long end, bool direct)
 {
 	unsigned long next;
+	unsigned long addr;
 	pgd_t *pgd;
 	pud_t *pud;
 	bool pgd_changed = false;
 
-	for (; start < end; start = next) {
-		next = pgd_addr_end(start, end);
+	for (addr = start; addr < end; addr = next) {
+		next = pgd_addr_end(addr, end);
 
-		pgd = pgd_offset_k(start);
+		pgd = pgd_offset_k(addr);
 		if (!pgd_present(*pgd))
 			continue;
 
 		pud = (pud_t *)pgd_page_vaddr(*pgd);
-		remove_pud_table(pud, start, next, direct);
+		remove_pud_table(pud, addr, next, direct);
 		if (free_pud_table(pud, pgd))
 			pgd_changed = true;
 	}
 
 	if (pgd_changed)
-		sync_global_pgds(start, end - 1);
+		sync_global_pgds(start, end - 1, 1);
 
 	flush_tlb_all();
 }
@@ -1324,7 +1336,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
 	else
 		err = vmemmap_populate_basepages(start, end, node);
 	if (!err)
-		sync_global_pgds(start, end - 1);
+		sync_global_pgds(start, end - 1, 0);
 	return err;
 }
 
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 7d4a8d2..ebcec74 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -700,7 +700,7 @@ struct crypto_ablkcipher *crypto_alloc_ablkcipher(const char *alg_name,
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 00d8d93..daf2f65 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -325,7 +325,7 @@ static void crypto_wait_for_test(struct crypto_larval *larval)
 		crypto_alg_tested(larval->alg.cra_driver_name, 0);
 	}
 
-	err = wait_for_completion_interruptible(&larval->completion);
+	err = wait_for_completion_killable(&larval->completion);
 	WARN_ON(err);
 
 out:
diff --git a/crypto/api.c b/crypto/api.c
index 2a81e98..7db2e89 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -172,7 +172,7 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
 	struct crypto_larval *larval = (void *)alg;
 	long timeout;
 
-	timeout = wait_for_completion_interruptible_timeout(
+	timeout = wait_for_completion_killable_timeout(
 		&larval->completion, 60 * HZ);
 
 	alg = larval->adult;
@@ -435,7 +435,7 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask)
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
@@ -552,7 +552,7 @@ void *crypto_alloc_tfm(const char *alg_name,
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 43665d0..c7666f4 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -361,7 +361,7 @@ static struct crypto_alg *crypto_user_aead_alg(const char *name, u32 type,
 		err = PTR_ERR(alg);
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 53111fd..f354867 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -67,6 +67,7 @@ enum board_ids {
 	board_ahci_yes_fbs,
 
 	/* board IDs for specific chipsets in alphabetical order */
+	board_ahci_avn,
 	board_ahci_mcp65,
 	board_ahci_mcp77,
 	board_ahci_mcp89,
@@ -85,6 +86,8 @@ enum board_ids {
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
 				 unsigned long deadline);
+static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
+			      unsigned long deadline);
 static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
 				unsigned long deadline);
 #ifdef CONFIG_PM
@@ -106,6 +109,11 @@ static struct ata_port_operations ahci_p5wdh_ops = {
 	.hardreset		= ahci_p5wdh_hardreset,
 };
 
+static struct ata_port_operations ahci_avn_ops = {
+	.inherits		= &ahci_ops,
+	.hardreset		= ahci_avn_hardreset,
+};
+
 static const struct ata_port_info ahci_port_info[] = {
 	/* by features */
 	[board_ahci] = {
@@ -150,6 +158,12 @@ static const struct ata_port_info ahci_port_info[] = {
 		.port_ops	= &ahci_ops,
 	},
 	/* by chipsets */
+	[board_ahci_avn] = {
+		.flags		= AHCI_FLAG_COMMON,
+		.pio_mask	= ATA_PIO4,
+		.udma_mask	= ATA_UDMA6,
+		.port_ops	= &ahci_avn_ops,
+	},
 	[board_ahci_mcp65] = {
 		AHCI_HFLAGS	(AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP |
 				 AHCI_HFLAG_YES_NCQ),
@@ -289,14 +303,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x1f27), board_ahci }, /* Avoton RAID */
 	{ PCI_VDEVICE(INTEL, 0x1f2e), board_ahci }, /* Avoton RAID */
 	{ PCI_VDEVICE(INTEL, 0x1f2f), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f32), board_ahci }, /* Avoton AHCI */
-	{ PCI_VDEVICE(INTEL, 0x1f33), board_ahci }, /* Avoton AHCI */
-	{ PCI_VDEVICE(INTEL, 0x1f34), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f35), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f36), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f37), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f3e), board_ahci }, /* Avoton RAID */
-	{ PCI_VDEVICE(INTEL, 0x1f3f), board_ahci }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f32), board_ahci_avn }, /* Avoton AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1f33), board_ahci_avn }, /* Avoton AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1f34), board_ahci_avn }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f35), board_ahci_avn }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f36), board_ahci_avn }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f37), board_ahci_avn }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f3e), board_ahci_avn }, /* Avoton RAID */
+	{ PCI_VDEVICE(INTEL, 0x1f3f), board_ahci_avn }, /* Avoton RAID */
 	{ PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Wellsburg RAID */
 	{ PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Wellsburg RAID */
 	{ PCI_VDEVICE(INTEL, 0x8d02), board_ahci }, /* Wellsburg AHCI */
@@ -608,6 +622,7 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
 				 unsigned long deadline)
 {
 	struct ata_port *ap = link->ap;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	bool online;
 	int rc;
 
@@ -618,7 +633,7 @@ static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class,
 	rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context),
 				 deadline, &online, NULL);
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 
 	DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
 
@@ -633,6 +648,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
 {
 	struct ata_port *ap = link->ap;
 	struct ahci_port_priv *pp = ap->private_data;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
 	struct ata_taskfile tf;
 	bool online;
@@ -648,7 +664,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
 	rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context),
 				 deadline, &online, NULL);
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 
 	/* The pseudo configuration device on SIMG4726 attached to
 	 * ASUS P5W-DH Deluxe doesn't send signature FIS after
@@ -672,6 +688,79 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
 	return rc;
 }
 
+/*
+ * ahci_avn_hardreset - attempt more aggressive recovery of Avoton ports.
+ *
+ * It has been observed with some SSDs that the timing of events in the
+ * link synchronization phase can leave the port in a state that can not
+ * be recovered by a SATA-hard-reset alone.  The failing signature is
+ * SStatus.DET stuck at 1 ("Device presence detected but Phy
+ * communication not established").  It was found that unloading and
+ * reloading the driver when this problem occurs allows the drive
+ * connection to be recovered (DET advanced to 0x3).  The critical
+ * component of reloading the driver is that the port state machines are
+ * reset by bouncing "port enable" in the AHCI PCS configuration
+ * register.  So, reproduce that effect by bouncing a port whenever we
+ * see DET==1 after a reset.
+ */
+static int ahci_avn_hardreset(struct ata_link *link, unsigned int *class,
+			      unsigned long deadline)
+{
+	const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
+	struct ata_port *ap = link->ap;
+	struct ahci_port_priv *pp = ap->private_data;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
+	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
+	unsigned long tmo = deadline - jiffies;
+	struct ata_taskfile tf;
+	bool online;
+	int rc, i;
+
+	DPRINTK("ENTER\n");
+
+	ahci_stop_engine(ap);
+
+	for (i = 0; i < 2; i++) {
+		u16 val;
+		u32 sstatus;
+		int port = ap->port_no;
+		struct ata_host *host = ap->host;
+		struct pci_dev *pdev = to_pci_dev(host->dev);
+
+		/* clear D2H reception area to properly wait for D2H FIS */
+		ata_tf_init(link->device, &tf);
+		tf.command = ATA_BUSY;
+		ata_tf_to_fis(&tf, 0, 0, d2h_fis);
+
+		rc = sata_link_hardreset(link, timing, deadline, &online,
+				ahci_check_ready);
+
+		if (sata_scr_read(link, SCR_STATUS, &sstatus) != 0 ||
+				(sstatus & 0xf) != 1)
+			break;
+
+		ata_link_printk(link, KERN_INFO, "avn bounce port%d\n",
+				port);
+
+		pci_read_config_word(pdev, 0x92, &val);
+		val &= ~(1 << port);
+		pci_write_config_word(pdev, 0x92, val);
+		ata_msleep(ap, 1000);
+		val |= 1 << port;
+		pci_write_config_word(pdev, 0x92, val);
+		deadline += tmo;
+	}
+
+	hpriv->start_engine(ap);
+
+	if (online)
+		*class = ahci_dev_classify(ap);
+
+	DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
+	return rc;
+}
+
+
 #ifdef CONFIG_PM
 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 1145637..e06ac08 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -323,6 +323,12 @@ struct ahci_host_priv {
 	u32			em_msg_type;	/* EM message type */
 	struct clk		*clk;		/* Only for platforms supporting clk */
 	void			*plat_data;	/* Other platform data */
+	/*
+	 * Optional ahci_start_engine override, if not set this gets set to the
+	 * default ahci_start_engine during ahci_save_initial_config, this can
+	 * be overridden anytime before the host is activated.
+	 */
+	void			(*start_engine)(struct ata_port *ap);
 };
 
 extern int ahci_ignore_sss;
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 9764d9c..07b3f903 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -394,6 +394,9 @@ static ssize_t ahci_show_em_supported(struct device *dev,
  *
  *	If inconsistent, config values are fixed up by this function.
  *
+ *	If it is not set already this function sets hpriv->start_engine to
+ *	ahci_start_engine.
+ *
  *	LOCKING:
  *	None.
  */
@@ -500,6 +503,9 @@ void ahci_save_initial_config(struct device *dev,
 	hpriv->cap = cap;
 	hpriv->cap2 = cap2;
 	hpriv->port_map = port_map;
+
+	if (!hpriv->start_engine)
+		hpriv->start_engine = ahci_start_engine;
 }
 EXPORT_SYMBOL_GPL(ahci_save_initial_config);
 
@@ -766,7 +772,7 @@ static void ahci_start_port(struct ata_port *ap)
 
 	/* enable DMA */
 	if (!(hpriv->flags & AHCI_HFLAG_DELAY_ENGINE))
-		ahci_start_engine(ap);
+		hpriv->start_engine(ap);
 
 	/* turn on LEDs */
 	if (ap->flags & ATA_FLAG_EM) {
@@ -1234,7 +1240,7 @@ int ahci_kick_engine(struct ata_port *ap)
 
 	/* restart engine */
  out_restart:
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(ahci_kick_engine);
@@ -1426,6 +1432,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
 	const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
 	struct ata_port *ap = link->ap;
 	struct ahci_port_priv *pp = ap->private_data;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
 	struct ata_taskfile tf;
 	bool online;
@@ -1443,7 +1450,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
 	rc = sata_link_hardreset(link, timing, deadline, &online,
 				 ahci_check_ready);
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 
 	if (online)
 		*class = ahci_dev_classify(ap);
@@ -2006,10 +2013,12 @@ static void ahci_thaw(struct ata_port *ap)
 
 static void ahci_error_handler(struct ata_port *ap)
 {
+	struct ahci_host_priv *hpriv = ap->host->private_data;
+
 	if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
 		/* restart engine */
 		ahci_stop_engine(ap);
-		ahci_start_engine(ap);
+		hpriv->start_engine(ap);
 	}
 
 	sata_pmp_error_handler(ap);
@@ -2029,6 +2038,7 @@ static void ahci_post_internal_cmd(struct ata_queued_cmd *qc)
 
 static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
 {
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	void __iomem *port_mmio = ahci_port_base(ap);
 	struct ata_device *dev = ap->link.device;
 	u32 devslp, dm, dito, mdat, deto;
@@ -2092,7 +2102,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
 		   PORT_DEVSLP_ADSE);
 	writel(devslp, port_mmio + PORT_DEVSLP);
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 
 	/* enable device sleep feature for the drive */
 	err_mask = ata_dev_set_feature(dev,
@@ -2104,6 +2114,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
 
 static void ahci_enable_fbs(struct ata_port *ap)
 {
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	struct ahci_port_priv *pp = ap->private_data;
 	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 fbs;
@@ -2132,11 +2143,12 @@ static void ahci_enable_fbs(struct ata_port *ap)
 	} else
 		dev_err(ap->host->dev, "Failed to enable FBS\n");
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 }
 
 static void ahci_disable_fbs(struct ata_port *ap)
 {
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	struct ahci_port_priv *pp = ap->private_data;
 	void __iomem *port_mmio = ahci_port_base(ap);
 	u32 fbs;
@@ -2164,7 +2176,7 @@ static void ahci_disable_fbs(struct ata_port *ap)
 		pp->fbs_enabled = false;
 	}
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 }
 
 static void ahci_pmp_attach(struct ata_port *ap)
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 7f5e5d9..fa402bb 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -406,6 +406,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
 	static const unsigned long timing[] = { 5, 100, 500};
 	struct ata_port *ap = link->ap;
 	struct ahci_port_priv *pp = ap->private_data;
+	struct ahci_host_priv *hpriv = ap->host->private_data;
 	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
 	struct ata_taskfile tf;
 	bool online;
@@ -434,7 +435,7 @@ static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
 			break;
 	} while (!online && retry--);
 
-	ahci_start_engine(ap);
+	hpriv->start_engine(ap);
 
 	if (online)
 		*class = ahci_dev_classify(ap);
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 66f6327..6be3153 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -93,6 +93,8 @@ static int atomic_dec_return_safe(atomic_t *v)
 
 #define RBD_MINORS_PER_MAJOR	256		/* max minors per blkdev */
 
+#define RBD_MAX_PARENT_CHAIN_LEN	16
+
 #define RBD_SNAP_DEV_NAME_PREFIX	"snap_"
 #define RBD_MAX_SNAP_NAME_LEN	\
 			(NAME_MAX - (sizeof (RBD_SNAP_DEV_NAME_PREFIX) - 1))
@@ -394,7 +396,7 @@ static ssize_t rbd_add(struct bus_type *bus, const char *buf,
 		       size_t count);
 static ssize_t rbd_remove(struct bus_type *bus, const char *buf,
 			  size_t count);
-static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping);
+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth);
 static void rbd_spec_put(struct rbd_spec *spec);
 
 static BUS_ATTR(add, S_IWUSR, NULL, rbd_add);
@@ -3441,6 +3443,9 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
 	blk_queue_io_opt(q, segment_size);
 
 	blk_queue_merge_bvec(q, rbd_merge_bvec);
+	if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))
+		q->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES;
+
 	disk->queue = q;
 
 	q->queuedata = rbd_dev;
@@ -4836,44 +4841,50 @@ out_err:
 	return ret;
 }
 
-static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
+/*
+ * @depth is rbd_dev_image_probe() -> rbd_dev_probe_parent() ->
+ * rbd_dev_image_probe() recursion depth, which means it's also the
+ * length of the already discovered part of the parent chain.
+ */
+static int rbd_dev_probe_parent(struct rbd_device *rbd_dev, int depth)
 {
 	struct rbd_device *parent = NULL;
-	struct rbd_spec *parent_spec;
-	struct rbd_client *rbdc;
 	int ret;
 
 	if (!rbd_dev->parent_spec)
 		return 0;
-	/*
-	 * We need to pass a reference to the client and the parent
-	 * spec when creating the parent rbd_dev.  Images related by
-	 * parent/child relationships always share both.
-	 */
-	parent_spec = rbd_spec_get(rbd_dev->parent_spec);
-	rbdc = __rbd_get_client(rbd_dev->rbd_client);
 
-	ret = -ENOMEM;
-	parent = rbd_dev_create(rbdc, parent_spec);
-	if (!parent)
+	if (++depth > RBD_MAX_PARENT_CHAIN_LEN) {
+		pr_info("parent chain is too long (%d)\n", depth);
+		ret = -EINVAL;
 		goto out_err;
+	}
 
-	ret = rbd_dev_image_probe(parent, false);
+	parent = rbd_dev_create(rbd_dev->rbd_client, rbd_dev->parent_spec);
+	if (!parent) {
+		ret = -ENOMEM;
+		goto out_err;
+	}
+
+	/*
+	 * Images related by parent/child relationships always share
+	 * rbd_client and spec/parent_spec, so bump their refcounts.
+	 */
+	__rbd_get_client(rbd_dev->rbd_client);
+	rbd_spec_get(rbd_dev->parent_spec);
+
+	ret = rbd_dev_image_probe(parent, depth);
 	if (ret < 0)
 		goto out_err;
+
 	rbd_dev->parent = parent;
 	atomic_set(&rbd_dev->parent_ref, 1);
-
 	return 0;
+
 out_err:
-	if (parent) {
-		rbd_dev_unparent(rbd_dev);
+	rbd_dev_unparent(rbd_dev);
+	if (parent)
 		rbd_dev_destroy(parent);
-	} else {
-		rbd_put_client(rbdc);
-		rbd_spec_put(parent_spec);
-	}
-
 	return ret;
 }
 
@@ -4979,7 +4990,7 @@ static void rbd_dev_image_release(struct rbd_device *rbd_dev)
  * parent), initiate a watch on its header object before using that
  * object to get detailed information about the rbd image.
  */
-static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
+static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth)
 {
 	int ret;
 	int tmp;
@@ -5000,7 +5011,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
 	if (ret)
 		goto err_out_format;
 
-	if (mapping) {
+	if (!depth) {
 		ret = rbd_dev_header_watch_sync(rbd_dev, true);
 		if (ret)
 			goto out_header_name;
@@ -5017,7 +5028,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
 	if (ret)
 		goto err_out_probe;
 
-	ret = rbd_dev_probe_parent(rbd_dev);
+	ret = rbd_dev_probe_parent(rbd_dev, depth);
 	if (ret)
 		goto err_out_probe;
 
@@ -5028,7 +5039,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
 err_out_probe:
 	rbd_dev_unprobe(rbd_dev);
 err_out_watch:
-	if (mapping) {
+	if (!depth) {
 		tmp = rbd_dev_header_watch_sync(rbd_dev, false);
 		if (tmp)
 			rbd_warn(rbd_dev, "unable to tear down "
@@ -5099,7 +5110,7 @@ static ssize_t rbd_add(struct bus_type *bus,
 	rbdc = NULL;		/* rbd_dev now owns this */
 	spec = NULL;		/* rbd_dev now owns this */
 
-	rc = rbd_dev_image_probe(rbd_dev, true);
+	rc = rbd_dev_image_probe(rbd_dev, 0);
 	if (rc < 0)
 		goto err_out_rbd_dev;
 
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 7d0eb3f..0b6932c 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1965,7 +1965,8 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
-		blkfront_closing(info);
+		if (info)
+			blkfront_closing(info);
 		break;
 	}
 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index d2dfdf7..152d39d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -205,11 +205,12 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem,
 	struct nouveau_bo *nvbo = nouveau_gem_object(gem);
 	struct nouveau_vma *vma;
 
-	if (nvbo->bo.mem.mem_type == TTM_PL_TT)
+	if (is_power_of_2(nvbo->valid_domains))
+		rep->domain = nvbo->valid_domains;
+	else if (nvbo->bo.mem.mem_type == TTM_PL_TT)
 		rep->domain = NOUVEAU_GEM_DOMAIN_GART;
 	else
 		rep->domain = NOUVEAU_GEM_DOMAIN_VRAM;
-
 	rep->offset = nvbo->bo.offset;
 	if (cli->base.vm) {
 		vma = nouveau_bo_vma_find(nvbo, cli->base.vm);
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 784b97c..c410217 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -857,6 +857,11 @@ retest:
 	case IB_CM_SIDR_REQ_RCVD:
 		spin_unlock_irq(&cm_id_priv->lock);
 		cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
+		spin_lock_irq(&cm.lock);
+		if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node))



More information about the unionfs-cvs mailing list