1. 01 Mar, 2013 3 commits
    • Linus Torvalds's avatar
      Merge tag 'tag-for-linus-3.9' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf · 5e04f4b4
      Linus Torvalds authored
      Pull dma-buf framework updates from Sumit Semwal:
       "Refcounting implemented for vmap in core dma-buf"
      
      * tag 'tag-for-linus-3.9' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf:
        CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap
        dma-buf: implement vmap refcounting in the interface logic
      5e04f4b4
    • Linus Torvalds's avatar
      Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux · b6669737
      Linus Torvalds authored
      Pull nfsd changes from J Bruce Fields:
       "Miscellaneous bugfixes, plus:
      
         - An overhaul of the DRC cache by Jeff Layton.  The main effect is
           just to make it larger.  This decreases the chances of intermittent
           errors especially in the UDP case.  But we'll need to watch for any
           reports of performance regressions.
      
         - Containerized nfsd: with some limitations, we now support
           per-container nfs-service, thanks to extensive work from Stanislav
           Kinsbursky over the last year."
      
      Some notes about conflicts, since there were *two* non-data semantic
      conflicts here:
      
       - idr_remove_all() had been added by a memory leak fix, but has since
         become deprecated since idr_destroy() does it for us now.
      
       - xs_local_connect() had been added by this branch to make AF_LOCAL
         connections be synchronous, but in the meantime Trond had changed the
         calling convention in order to avoid a RCU dereference.
      
      There were a couple of more obvious actual source-level conflicts due to
      the hlist traversal changes and one just due to code changes next to
      each other, but those were trivial.
      
      * 'for-3.9' of git://linux-nfs.org/~bfields/linux: (49 commits)
        SUNRPC: make AF_LOCAL connect synchronous
        nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum
        svcrpc: fix rpc server shutdown races
        svcrpc: make svc_age_temp_xprts enqueue under sv_lock
        lockd: nlmclnt_reclaim(): avoid stack overflow
        nfsd: enable NFSv4 state in containers
        nfsd: disable usermode helper client tracker in container
        nfsd: use proper net while reading "exports" file
        nfsd: containerize NFSd filesystem
        nfsd: fix comments on nfsd_cache_lookup
        SUNRPC: move cache_detail->cache_request callback call to cache_read()
        SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
        SUNRPC: rework cache upcall logic
        SUNRPC: introduce cache_detail->cache_request callback
        NFS: simplify and clean cache library
        NFS: use SUNRPC cache creation and destruction helper for DNS cache
        nfsd4: free_stid can be static
        nfsd: keep a checksum of the first 256 bytes of request
        sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer
        sunrpc: fix comment in struct xdr_buf definition
        ...
      b6669737
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 1cf0209c
      Linus Torvalds authored
      Pull Ceph updates from Sage Weil:
       "A few groups of patches here.  Alex has been hard at work improving
        the RBD code, layout groundwork for understanding the new formats and
        doing layering.  Most of the infrastructure is now in place for the
        final bits that will come with the next window.
      
        There are a few changes to the data layout.  Jim Schutt's patch fixes
        some non-ideal CRUSH behavior, and a set of patches from me updates
        the client to speak a newer version of the protocol and implement an
        improved hashing strategy across storage nodes (when the server side
        supports it too).
      
        A pair of patches from Sam Lang fix the atomicity of open+create
        operations.  Several patches from Yan, Zheng fix various mds/client
        issues that turned up during multi-mds torture tests.
      
        A final set of patches expose file layouts via virtual xattrs, and
        allow the policies to be set on directories via xattrs as well
        (avoiding the awkward ioctl interface and providing a consistent
        interface for both kernel mount and ceph-fuse users)."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (143 commits)
        libceph: add support for HASHPSPOOL pool flag
        libceph: update osd request/reply encoding
        libceph: calculate placement based on the internal data types
        ceph: update support for PGID64, PGPOOL3, OSDENC protocol features
        ceph: update "ceph_features.h"
        libceph: decode into cpu-native ceph_pg type
        libceph: rename ceph_pg -> ceph_pg_v1
        rbd: pass length, not op for osd completions
        rbd: move rbd_osd_trivial_callback()
        libceph: use a do..while loop in con_work()
        libceph: use a flag to indicate a fault has occurred
        libceph: separate non-locked fault handling
        libceph: encapsulate connection backoff
        libceph: eliminate sparse warnings
        ceph: eliminate sparse warnings in fs code
        rbd: eliminate sparse warnings
        libceph: define connection flag helpers
        rbd: normalize dout() calls
        rbd: barriers are hard
        rbd: ignore zero-length requests
        ...
      1cf0209c
  2. 28 Feb, 2013 37 commits
    • Linus Torvalds's avatar
      Merge tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux · de1a2262
      Linus Torvalds authored
      Pull writeback fixes from Wu Fengguang:
       "Two writeback fixes
      
         - fix negative (setpoint - dirty) in 32bit archs
      
         - use down_read_trylock() in writeback_inodes_sb(_nr)_if_idle()"
      
      * tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
        Negative (setpoint-dirty) in bdi_position_ratio()
        vfs: re-implement writeback_inodes_sb(_nr)_if_idle() and rename them
      de1a2262
    • Linus Torvalds's avatar
      Merge branch 'for-3.9/drivers' of git://git.kernel.dk/linux-block · f042fea0
      Linus Torvalds authored
      Pull block driver bits from Jens Axboe:
       "After the block IO core bits are in, please grab the driver updates
        from below as well.  It contains:
      
         - Fix ancient regression in dac960.  Nobody must be using that
           anymore...
      
         - Some good fixes from Guo Ghao for loop, fixing both potential
           oopses and deadlocks.
      
         - Improve mtip32xx for NUMA systems, by being a bit more clever in
           distributing work.
      
         - Add IBM RamSan 70/80 driver.  A second round of fixes for that is
           pending, that will come in through for-linus during the 3.9 cycle
           as per usual.
      
         - A few xen-blk{back,front} fixes from Konrad and Roger.
      
         - Other minor fixes and improvements."
      
      * 'for-3.9/drivers' of git://git.kernel.dk/linux-block:
        loopdev: ignore negative offset when calculate loop device size
        loopdev: remove an user triggerable oops
        loopdev: move common code into loop_figure_size()
        loopdev: update block device size in loop_set_status()
        loopdev: fix a deadlock
        xen-blkback: use balloon pages for persistent grants
        xen-blkfront: drop the use of llist_for_each_entry_safe
        xen/blkback: Don't trust the handle from the frontend.
        xen-blkback: do not leak mode property
        block: IBM RamSan 70/80 driver fixes
        rsxx: add slab.h include to dma.c
        drivers/block/mtip32xx: add missing GENERIC_HARDIRQS dependency
        block: remove new __devinit/exit annotations on ramsam driver
        block: IBM RamSan 70/80 device driver
        drivers/block/mtip32xx/mtip32xx.c:1726:5: sparse: symbol 'mtip_send_trim' was not declared. Should it be static?
        drivers/block/mtip32xx/mtip32xx.c:4029:1: sparse: symbol 'mtip_workq_sdbf0' was not declared. Should it be static?
        dac960: return success instead of -ENOTTY
        mtip32xx: add trim support
        mtip32xx: Add workqueue and NUMA support
        block: delete super ancient PC-XT driver for 1980's hardware
      f042fea0
    • Linus Torvalds's avatar
      Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block · ee89f812
      Linus Torvalds authored
      Pull block IO core bits from Jens Axboe:
       "Below are the core block IO bits for 3.9.  It was delayed a few days
        since my workstation kept crashing every 2-8h after pulling it into
        current -git, but turns out it is a bug in the new pstate code (divide
        by zero, will report separately).  In any case, it contains:
      
         - The big cfq/blkcg update from Tejun and and Vivek.
      
         - Additional block and writeback tracepoints from Tejun.
      
         - Improvement of the should sort (based on queues) logic in the plug
           flushing.
      
         - _io() variants of the wait_for_completion() interface, using
           io_schedule() instead of schedule() to contribute to io wait
           properly.
      
         - Various little fixes.
      
        You'll get two trivial merge conflicts, which should be easy enough to
        fix up"
      
      Fix up the trivial conflicts due to hlist traversal cleanups (commit
      b67bfe0d: "hlist: drop the node parameter from iterators").
      
      * 'for-3.9/core' of git://git.kernel.dk/linux-block: (39 commits)
        block: remove redundant check to bd_openers()
        block: use i_size_write() in bd_set_size()
        cfq: fix lock imbalance with failed allocations
        drivers/block/swim3.c: fix null pointer dereference
        block: don't select PERCPU_RWSEM
        block: account iowait time when waiting for completion of IO request
        sched: add wait_for_completion_io[_timeout]
        writeback: add more tracepoints
        block: add block_{touch|dirty}_buffer tracepoint
        buffer: make touch_buffer() an exported function
        block: add @req to bio_{front|back}_merge tracepoints
        block: add missing block_bio_complete() tracepoint
        block: Remove should_sort judgement when flush blk_plug
        block,elevator: use new hashtable implementation
        cfq-iosched: add hierarchical cfq_group statistics
        cfq-iosched: collect stats from dead cfqgs
        cfq-iosched: separate out cfqg_stats_reset() from cfq_pd_reset_stats()
        blkcg: make blkcg_print_blkgs() grab q locks instead of blkcg lock
        block: RCU free request_queue
        blkcg: implement blkg_[rw]stat_recursive_sum() and blkg_[rw]stat_merge()
        ...
      ee89f812
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 21f3b24d
      Linus Torvalds authored
      Pull first round of SCSI updates from James Bottomley:
       "The patch set is mostly driver updates (bnx2fc, ipr, lpfc, qla4) and a
        few bug fixes"
      
      Pull delayed because google hates James, and sneakily considers his pull
      requests spam. Why, google, why?
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (60 commits)
        [SCSI] aacraid: 1024 max outstanding command support for Series 7 and above
        [SCSI] bnx2fc: adjust duplicate test
        [SCSI] qla4xxx: Update driver version to 5.03.00-k4
        [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.
        [SCSI] qla4xxx: wait for boot target login response during probe.
        [SCSI] qla4xxx: Added support for force firmware dump
        [SCSI] qla4xxx: Re-register IRQ handler while retrying initialize of adapter
        [SCSI] qla4xxx: Throttle active IOCBs to firmware limits
        [SCSI] qla4xxx: Remove unnecessary code from qla4xxx_init_local_data
        [SCSI] qla4xxx: Quiesce driver activities while loopback
        [SCSI] qla4xxx: Rename MBOX_ASTS_IDC_NOTIFY to MBOX_ASTS_IDC_REQUEST_NOTIFICATION
        [SCSI] qla4xxx: Add spurious interrupt messages under debug level 2
        [SCSI] cxgb4i: Remove the scsi host device when removing device
        [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()
        [SCSI] qla4xxx: Update driver version to 5.03.00-k3
        [SCSI] qla4xxx: Correct the validation to check in get_sys_info mailbox
        [SCSI] qla4xxx: Pass correct function param to qla4_8xxx_rd_direct
        [SCSI] lpfc 8.3.37: Update lpfc version for 8.3.37 driver release
        [SCSI] lpfc 8.3.37: Fixed infinite loop in lpfc_sli4_fcf_rr_next_index_get.
        [SCSI] lpfc 8.3.37: Fixed crash due to SLI Port invalid resource count
        ...
      21f3b24d
    • J. Bruce Fields's avatar
      SUNRPC: make AF_LOCAL connect synchronous · dc107402
      J. Bruce Fields authored
      It doesn't appear that anyone actually needs to connect asynchronously.
      
      Also, using a workqueue for the connect means we lose the namespace
      information from the original process.  This is a problem since there's
      no way to explicitly pass in a filesystem namespace for resolution of an
      AF_LOCAL address.
      Acked-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      dc107402
    • Linus Torvalds's avatar
      Merge branch 'akpm' (final batch from Andrew) · 2a7d2b96
      Linus Torvalds authored
      Merge third patch-bumb from Andrew Morton:
       "This wraps me up for -rc1.
         - Lots of misc stuff and things which were deferred/missed from
           patchbombings 1 & 2.
         - ocfs2 things
         - lib/scatterlist
         - hfsplus
         - fatfs
         - documentation
         - signals
         - procfs
         - lockdep
         - coredump
         - seqfile core
         - kexec
         - Tejun's large IDR tree reworkings
         - ipmi
         - partitions
         - nbd
         - random() things
         - kfifo
         - tools/testing/selftests updates
         - Sasha's large and pointless hlist cleanup"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (163 commits)
        hlist: drop the node parameter from iterators
        kcmp: make it depend on CHECKPOINT_RESTORE
        selftests: add a simple doc
        tools/testing/selftests/Makefile: rearrange targets
        selftests/efivarfs: add create-read test
        selftests/efivarfs: add empty file creation test
        selftests: add tests for efivarfs
        kfifo: fix kfifo_alloc() and kfifo_init()
        kfifo: move kfifo.c from kernel/ to lib/
        arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS
        w1: add support for DS2413 Dual Channel Addressable Switch
        memstick: move the dereference below the NULL test
        drivers/pps/clients/pps-gpio.c: use devm_kzalloc
        Documentation/DMA-API-HOWTO.txt: fix typo
        include/linux/eventfd.h: fix incorrect filename is a comment
        mtd: mtd_stresstest: use prandom_bytes()
        mtd: mtd_subpagetest: convert to use prandom library
        mtd: mtd_speedtest: use prandom_bytes
        mtd: mtd_pagetest: convert to use prandom library
        mtd: mtd_oobtest: convert to use prandom library
        ...
      2a7d2b96
    • Sasha Levin's avatar
      hlist: drop the node parameter from iterators · b67bfe0d
      Sasha Levin authored
      I'm not sure why, but the hlist for each entry iterators were conceived
      
              list_for_each_entry(pos, head, member)
      
      The hlist ones were greedy and wanted an extra parameter:
      
              hlist_for_each_entry(tpos, pos, head, member)
      
      Why did they need an extra pos parameter? I'm not quite sure. Not only
      they don't really need it, it also prevents the iterator from looking
      exactly like the list iterator, which is unfortunate.
      
      Besides the semantic patch, there was some manual work required:
      
       - Fix up the actual hlist iterators in linux/list.h
       - Fix up the declaration of other iterators based on the hlist ones.
       - A very small amount of places were using the 'node' parameter, this
       was modified to use 'obj->member' instead.
       - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
       properly, so those had to be fixed up manually.
      
      The semantic patch which is mostly the work of Peter Senna Tschudin is here:
      
      @@
      iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
      
      type T;
      expression a,c,d,e;
      identifier b;
      statement S;
      @@
      
      -T b;
          <+... when != b
      (
      hlist_for_each_entry(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue(a,
      - b,
      c) S
      |
      hlist_for_each_entry_from(a,
      - b,
      c) S
      |
      hlist_for_each_entry_rcu(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_rcu_bh(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue_rcu_bh(a,
      - b,
      c) S
      |
      for_each_busy_worker(a, c,
      - b,
      d) S
      |
      ax25_uid_for_each(a,
      - b,
      c) S
      |
      ax25_for_each(a,
      - b,
      c) S
      |
      inet_bind_bucket_for_each(a,
      - b,
      c) S
      |
      sctp_for_each_hentry(a,
      - b,
      c) S
      |
      sk_for_each(a,
      - b,
      c) S
      |
      sk_for_each_rcu(a,
      - b,
      c) S
      |
      sk_for_each_from
      -(a, b)
      +(a)
      S
      + sk_for_each_from(a) S
      |
      sk_for_each_safe(a,
      - b,
      c, d) S
      |
      sk_for_each_bound(a,
      - b,
      c) S
      |
      hlist_for_each_entry_safe(a,
      - b,
      c, d, e) S
      |
      hlist_for_each_entry_continue_rcu(a,
      - b,
      c) S
      |
      nr_neigh_for_each(a,
      - b,
      c) S
      |
      nr_neigh_for_each_safe(a,
      - b,
      c, d) S
      |
      nr_node_for_each(a,
      - b,
      c) S
      |
      nr_node_for_each_safe(a,
      - b,
      c, d) S
      |
      - for_each_gfn_sp(a, c, d, b) S
      + for_each_gfn_sp(a, c, d) S
      |
      - for_each_gfn_indirect_valid_sp(a, c, d, b) S
      + for_each_gfn_indirect_valid_sp(a, c, d) S
      |
      for_each_host(a,
      - b,
      c) S
      |
      for_each_host_safe(a,
      - b,
      c, d) S
      |
      for_each_mesh_entry(a,
      - b,
      c, d) S
      )
          ...+>
      
      [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
      [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
      [akpm@linux-foundation.org: checkpatch fixes]
      [akpm@linux-foundation.org: fix warnings]
      [akpm@linux-foudnation.org: redo intrusive kvm changes]
      Tested-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b67bfe0d
    • Cyrill Gorcunov's avatar
      kcmp: make it depend on CHECKPOINT_RESTORE · 1e142b29
      Cyrill Gorcunov authored
      Since kcmp syscall has been implemented (initially on x86 architecture) a
      number of other archs wire it up as well: xtensa, sparc, sh, s390, mips,
      microblaze, m68k (not taking into account those who uses
      <asm-generic/unistd.h> for syscall numbers definitions).
      
      But the Makefile, which turns kcmp.o generation on still depends on former
      config-x86.  Thus get rid of this limitation and make kcmp.o depend on
      CHECKPOINT_RESTORE option.
      Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1e142b29
    • Jeremy Kerr's avatar
      selftests: add a simple doc · 80d03428
      Jeremy Kerr authored
      This change adds a little documentation to the tests under
      tools/testing/selftests/, based on akpm's explanation.
      
      [akpm@linux-foundation.org: move from Documentation to tools/testing/selftests/README.txt]
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      80d03428
    • Andrew Morton's avatar
      tools/testing/selftests/Makefile: rearrange targets · 66a01b96
      Andrew Morton authored
      Do it one-per-line to reduce patch conflict pain.
      
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      66a01b96
    • Jeremy Kerr's avatar
      selftests/efivarfs: add create-read test · d974f67a
      Jeremy Kerr authored
      Test that reads from a newly-created efivarfs file (with no data written)
      will return EOF.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Lingzhu Xiang <lxiang@redhat.com>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d974f67a
    • Jeremy Kerr's avatar
      selftests/efivarfs: add empty file creation test · 033a1a7f
      Jeremy Kerr authored
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Lingzhu Xiang <lxiang@redhat.com>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      033a1a7f
    • Jeremy Kerr's avatar
      selftests: add tests for efivarfs · 455ce1c7
      Jeremy Kerr authored
      This change adds a few initial efivarfs tests to the
      tools/testing/selftests directory.
      
      The open-unlink test is based on code from Lingzhu Xiang.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Lingzhu Xiang <lxiang@redhat.com>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      455ce1c7
    • Stefani Seibold's avatar
      kfifo: fix kfifo_alloc() and kfifo_init() · dfe2a77f
      Stefani Seibold authored
      Fix kfifo_alloc() and kfifo_init() to alloc at least the requested number
      of elements.  Since the kfifo operates on power of 2 the request size will
      be rounded up to the next power of two.
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dfe2a77f
    • Stefani Seibold's avatar
      kfifo: move kfifo.c from kernel/ to lib/ · c759b35e
      Stefani Seibold authored
      Move kfifo.c from kernel/ to lib/
      Signed-off-by: default avatarStefani Seibold <stefani@seibold.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c759b35e
    • Stephen Rothwell's avatar
      arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS · 887cbce0
      Stephen Rothwell authored
      Change it to CONFIG_HAVE_VIRT_TO_BUS and set it in all architecures
      that already provide virt_to_bus().
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: H Hartley Sweeten <hartleys@visionengravers.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      887cbce0
    • Mariusz Bialonczyk's avatar
      w1: add support for DS2413 Dual Channel Addressable Switch · 31b4ca3e
      Mariusz Bialonczyk authored
      Also fixes some whitespace inconsistency in Kconfig and w1_family.h when
      DS2408 chip support was added.
      Signed-off-by: default avatarMariusz Bialonczyk <manio@skyboo.net>
      Acked-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      31b4ca3e
    • Wei Yongjun's avatar
      memstick: move the dereference below the NULL test · 940da353
      Wei Yongjun authored
      The dereference should be moved below the NULL test.
      
      spatch with a semantic match is used to found this.
      (http://coccinelle.lip6.fr/)
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: Maxim Levitsky <maximlevitsky@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      940da353
    • Julia Lawall's avatar
      drivers/pps/clients/pps-gpio.c: use devm_kzalloc · 507063b2
      Julia Lawall authored
      devm_kzalloc allocates memory that is released when a driver detaches.
      This patch uses devm_kzalloc for data that is allocated in the probe
      function of a platform device and is only freed in the remove function.
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Cc: Rodolfo Giometti <giometti@enneenne.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      507063b2
    • Andrew Morton's avatar
      Documentation/DMA-API-HOWTO.txt: fix typo · 11cd3db0
      Andrew Morton authored
      Noted by Jesper
      
      Cc: Jesper Juhl <jj@chaosbits.net>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Shuah Khan <shuah.khan@hp.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11cd3db0
    • Martin Sustrik's avatar
      include/linux/eventfd.h: fix incorrect filename is a comment · 1d730c49
      Martin Sustrik authored
      Comment in eventfd.h referred to 'include/asm-generic/fcntl.h'
      while the correct path is 'include/uapi/asm-generic/fcntl.h'.
      Signed-off-by: default avatarMartin Sustrik <sustrik@250bpm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1d730c49
    • Akinobu Mita's avatar
      mtd: mtd_stresstest: use prandom_bytes() · 4debec7a
      Akinobu Mita authored
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4debec7a
    • Akinobu Mita's avatar
      mtd: mtd_subpagetest: convert to use prandom library · a312b78b
      Akinobu Mita authored
      This removes home-brewed pseudo-random number generator and use
      prandom library.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a312b78b
    • Akinobu Mita's avatar
      mtd: mtd_speedtest: use prandom_bytes · 99672f32
      Akinobu Mita authored
      Use prandom_bytes instead of equivalent local function.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      99672f32
    • Akinobu Mita's avatar
      mtd: mtd_pagetest: convert to use prandom library · 825b8ccb
      Akinobu Mita authored
      This removes home-brewed pseudo-random number generator and use
      prandom library.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      825b8ccb
    • Akinobu Mita's avatar
      mtd: mtd_oobtest: convert to use prandom library · 8dad0498
      Akinobu Mita authored
      This removes home-brewed pseudo-random number generator and use
      prandom library.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8dad0498
    • Akinobu Mita's avatar
      mtd: mtd_nandecctest: use prandom_bytes instead of get_random_bytes() · 459a86d8
      Akinobu Mita authored
      Using prandom_bytes() is enough.  Because this data is only used
      for testing, not used for cryptographic use.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Laight <david.laight@aculab.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      459a86d8
    • Yuanhan Liu's avatar
      kernel/utsname.c: fix wrong comment about clone_uts_ns() · bf531536
      Yuanhan Liu authored
      Fix the wrong comment about the return value of clone_uts_ns()
      Signed-off-by: default avatarYuanhan Liu <yuanhan.liu@linux.intel.com>
      Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bf531536
    • Alex Elder's avatar
      nbd: fix sparse warning · 398eb085
      Alex Elder authored
      I just fixed this in "drivers/block/rbd.c" and I noticed that
      "drivers/block/nbd.c" has the same problem.  Fix a warning issued by
      sparse by adding some lockdep annotations to indicate the queue lock gets
      dropped (because it's held when do_nbd_request() is called) and
      re-acquired within the function.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Paul Clements <paul.clements@us.sios.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      398eb085
    • Wouter Verhelst's avatar
      nbd: update documentation and link to mailinglist · 5e4b269b
      Wouter Verhelst authored
      Documentation/blockdev/nbd.txt contained some documentation which was
      horribly outdated and probably still dates from the original patch that
      added NBD support to the kernel.
      
      This patch removes the useless and outdated bits.  The tools on nbd.sf.net
      are fully documented in manpages, which is where documentation for the
      non-kernel bits should live.
      
      Additionally, add a reference to the MAINTAINERS file for the nbd-general
      mailinglist that is used for discussion of the userland tools and the
      kernel module already.
      Signed-off-by: default avatarWouter Verhelst <w@uter.be>
      Cc: Paul Clements <Paul.Clements@steeleye.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5e4b269b
    • Paolo Bonzini's avatar
      nbd: show read-only state in sysfs · a83e814b
      Paolo Bonzini authored
      Pass the read-only flag to set_device_ro, so that it will be visible to
      the block layer and in sysfs.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Cc: Paul Clements <Paul.Clements@steeleye.com>
      Cc: Alex Bligh <alex@alex.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a83e814b
    • Paolo Bonzini's avatar
      nbd: fsync and kill block device on shutdown · 3a2d63f8
      Paolo Bonzini authored
      There are two problems with shutdown in the NBD driver.
      
      1: Receiving the NBD_DISCONNECT ioctl does not sync the filesystem.
      
         This patch adds the sync operation into __nbd_ioctl()'s
         NBD_DISCONNECT handler.  This is useful because BLKFLSBUF is restricted
         to processes that have CAP_SYS_ADMIN, and the NBD client may not
         possess it (fsync of the block device does not sync the filesystem,
         either).
      
      2: Once we clear the socket we have no guarantee that later reads will
         come from the same backing storage.
      
         The patch adds calls to kill_bdev() in __nbd_ioctl()'s socket
         clearing code so the page cache is cleaned, lest reads that hit on the
         page cache will return stale data from the previously-accessible disk.
      
      Example:
      
          # qemu-nbd -r -c/dev/nbd0 /dev/sr0
          # file -s /dev/nbd0
          /dev/stdin: # UDF filesystem data (version 1.5) etc.
          # qemu-nbd -d /dev/nbd0
          # qemu-nbd -r -c/dev/nbd0 /dev/sda
          # file -s /dev/nbd0
          /dev/stdin: # UDF filesystem data (version 1.5) etc.
      
      While /dev/sda has:
      
          # file -s /dev/sda
          /dev/sda: x86 boot sector; etc.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Acked-by: default avatarPaul Clements <Paul.Clements@steeleye.com>
      Cc: Alex Bligh <alex@alex.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a2d63f8
    • Alex Bligh's avatar
      nbd: support FLUSH requests · 75f187ab
      Alex Bligh authored
      Currently, the NBD device does not accept flush requests from the Linux
      block layer.  If the NBD server opened the target with neither O_SYNC nor
      O_DSYNC, however, the device will be effectively backed by a writeback
      cache.  Without issuing flushes properly, operation of the NBD device will
      not be safe against power losses.
      
      The NBD protocol has support for both a cache flush command and a FUA
      command flag; the server will also pass a flag to note its support for
      these features.  This patch adds support for the cache flush command and
      flag.  In the kernel, we receive the flags via the NBD_SET_FLAGS ioctl,
      and map NBD_FLAG_SEND_FLUSH to the argument of blk_queue_flush.  When the
      flag is active the block layer will send REQ_FLUSH requests, which we
      translate to NBD_CMD_FLUSH commands.
      
      FUA support is not included in this patch because all free software
      servers implement it with a full fdatasync; thus it has no advantage over
      supporting flush only.  Because I [Paolo] cannot really benchmark it in a
      realistic scenario, I cannot tell if it is a good idea or not.  It is also
      not clear if it is valid for an NBD server to support FUA but not flush.
      The Linux block layer gives a warning for this combination, the NBD
      protocol documentation says nothing about it.
      
      The patch also fixes a small problem in the handling of flags: nbd->flags
      must be cleared at the end of NBD_DO_IT, but the driver was not doing
      that.  The bug manifests itself as follows.  Suppose you two different
      client/server pairs to start the NBD device.  Suppose also that the first
      client supports NBD_SET_FLAGS, and the first server sends
      NBD_FLAG_SEND_FLUSH; the second pair instead does neither of these two
      things.  Before this patch, the second invocation of NBD_DO_IT will use a
      stale value of nbd->flags, and the second server will issue an error every
      time it receives an NBD_CMD_FLUSH command.
      
      This bug is pre-existing, but it becomes much more important after this
      patch; flush failures make the device pretty much unusable, unlike
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarAlex Bligh <alex@alex.org.uk>
      Acked-by: default avatarPaul Clements <Paul.Clements@steeleye.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      75f187ab
    • Yuanhan Liu's avatar
      kernel/utsname_sysctl.c: put get/get_uts() into CONFIG_PROC_SYSCTL code block · cd89f46b
      Yuanhan Liu authored
      Put get/get_uts() into CONFIG_PROC_SYSCTL code block as they are used
      only when CONFIG_PROC_SYSCTL is enabled.
      Signed-off-by: default avatarYuanhan Liu <yuanhan.liu@linux.intel.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd89f46b
    • Xi Wang's avatar
      sysctl: fix null checking in bin_dn_node_address() · df1778be
      Xi Wang authored
      The null check of `strchr() + 1' is broken, which is always non-null,
      leading to OOB read.  Instead, check the result of strchr().
      Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      df1778be
    • Ming Lei's avatar
      block/partitions: optimize memory allocation in check_partition() · ac2e5327
      Ming Lei authored
      Currently, sizeof(struct parsed_partitions) may be 64KB in 32bit arch, so
      it is easy to trigger page allocation failure by check_partition,
      especially in hotplug block device situation(such as, USB mass storage,
      MMC card, ...), and Felipe Balbi has observed the failure.
      
      This patch does below optimizations on the allocation of struct
      parsed_partitions to try to address the issue:
      
      - make parsed_partitions.parts as pointer so that the pointed memory can
        fit in 32KB buffer, then approximate 32KB memory can be saved
      
      - vmalloc the buffer pointed by parsed_partitions.parts because 32KB is
        still a bit big for kmalloc
      
      - given that many devices have the partition count limit, so only
        allocate disk_max_parts() partitions instead of 256 partitions always
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Reported-by: default avatarFelipe Balbi <balbi@ti.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Reviewed-by: default avatarYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ac2e5327
    • Ming Lei's avatar
      block/partitions/mac.c: obey the state->limit constraint · 06004e6e
      Ming Lei authored
      It isn't necessary to read the information of partitions whose number is
      equal and more than state->limit since only maximum state->limit
      partitions will be added inside rescan_partitions().
      
      That is also what other kind of partitions are doing.
      Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      06004e6e