1. 02 3月, 2013 2 次提交
    • M
      dm: fix truncated status strings · fd7c092e
      Mikulas Patocka 提交于
      Avoid returning a truncated table or status string instead of setting
      the DM_BUFFER_FULL_FLAG when the last target of a table fills the
      buffer.
      
      When processing a table or status request, the function retrieve_status
      calls ti->type->status. If ti->type->status returns non-zero,
      retrieve_status assumes that the buffer overflowed and sets
      DM_BUFFER_FULL_FLAG.
      
      However, targets don't return non-zero values from their status method
      on overflow. Most targets returns always zero.
      
      If a buffer overflow happens in a target that is not the last in the
      table, it gets noticed during the next iteration of the loop in
      retrieve_status; but if a buffer overflow happens in the last target, it
      goes unnoticed and erroneously truncated data is returned.
      
      In the current code, the targets behave in the following way:
      * dm-crypt returns -ENOMEM if there is not enough space to store the
        key, but it returns 0 on all other overflows.
      * dm-thin returns errors from the status method if a disk error happened.
        This is incorrect because retrieve_status doesn't check the error
        code, it assumes that all non-zero values mean buffer overflow.
      * all the other targets always return 0.
      
      This patch changes the ti->type->status function to return void (because
      most targets don't use the return code). Overflow is detected in
      retrieve_status: if the status method fills up the remaining space
      completely, it is assumed that buffer overflow happened.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      fd7c092e
    • J
      dm: do not replace bioset for request based dm · 16245bdc
      Jun'ichi Nomura 提交于
      This patch fixes a regression introduced in v3.8, which causes oops
      like this when dm-multipath is used:
      
      general protection fault: 0000 [#1] SMP
      RIP: 0010:[<ffffffff810fe754>]  [<ffffffff810fe754>] mempool_free+0x24/0xb0
      Call Trace:
        <IRQ>
        [<ffffffff81187417>] bio_put+0x97/0xc0
        [<ffffffffa02247a5>] end_clone_bio+0x35/0x90 [dm_mod]
        [<ffffffff81185efd>] bio_endio+0x1d/0x30
        [<ffffffff811f03a3>] req_bio_endio.isra.51+0xa3/0xe0
        [<ffffffff811f2f68>] blk_update_request+0x118/0x520
        [<ffffffff811f3397>] blk_update_bidi_request+0x27/0xa0
        [<ffffffff811f343c>] blk_end_bidi_request+0x2c/0x80
        [<ffffffff811f34d0>] blk_end_request+0x10/0x20
        [<ffffffffa000b32b>] scsi_io_completion+0xfb/0x6c0 [scsi_mod]
        [<ffffffffa000107d>] scsi_finish_command+0xbd/0x120 [scsi_mod]
        [<ffffffffa000b12f>] scsi_softirq_done+0x13f/0x160 [scsi_mod]
        [<ffffffff811f9fd0>] blk_done_softirq+0x80/0xa0
        [<ffffffff81044551>] __do_softirq+0xf1/0x250
        [<ffffffff8142ee8c>] call_softirq+0x1c/0x30
        [<ffffffff8100420d>] do_softirq+0x8d/0xc0
        [<ffffffff81044885>] irq_exit+0xd5/0xe0
        [<ffffffff8142f3e3>] do_IRQ+0x63/0xe0
        [<ffffffff814257af>] common_interrupt+0x6f/0x6f
        <EOI>
        [<ffffffffa021737c>] srp_queuecommand+0x8c/0xcb0 [ib_srp]
        [<ffffffffa0002f18>] scsi_dispatch_cmd+0x148/0x310 [scsi_mod]
        [<ffffffffa000a38e>] scsi_request_fn+0x31e/0x520 [scsi_mod]
        [<ffffffff811f1e57>] __blk_run_queue+0x37/0x50
        [<ffffffff811f1f69>] blk_delay_work+0x29/0x40
        [<ffffffff81059003>] process_one_work+0x1c3/0x5c0
        [<ffffffff8105b22e>] worker_thread+0x15e/0x440
        [<ffffffff8106164b>] kthread+0xdb/0xe0
        [<ffffffff8142db9c>] ret_from_fork+0x7c/0xb0
      
      The regression was introduced by the change
      c0820cf5 "dm: introduce per_bio_data", where dm started to replace
      bioset during table replacement.
      For bio-based dm, it is good because clone bios do not exist during the
      table replacement.
      For request-based dm, however, (not-yet-mapped) clone bios may stay in
      request queue and survive during the table replacement.
      So freeing the old bioset could cause the oops in bio_put().
      
      Since the size of front_pad may change only with bio-based dm,
      it is not necessary to replace bioset for request-based dm.
      Reported-by: NBart Van Assche <bvanassche@acm.org>
      Tested-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Acked-by: NMikulas Patocka <mpatocka@redhat.com>
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      16245bdc
  2. 01 3月, 2013 7 次提交
    • L
      Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux · b6669737
      Linus Torvalds 提交于
      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
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 1cf0209c
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux · de1a2262
      Linus Torvalds 提交于
      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
    • L
      Merge branch 'for-3.9/drivers' of git://git.kernel.dk/linux-block · f042fea0
      Linus Torvalds 提交于
      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
    • L
      Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block · ee89f812
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 21f3b24d
      Linus Torvalds 提交于
      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
      SUNRPC: make AF_LOCAL connect synchronous · dc107402
      J. Bruce Fields 提交于
      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: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      dc107402
  3. 28 2月, 2013 31 次提交