1. 01 Mar, 2013 9 commits
    • Alasdair G Kergon's avatar
      dm: remove CONFIG_EXPERIMENTAL · d57916a0
      Alasdair G Kergon authored
      Remove EXPERIMENTAL from all existing device-mapper targets.
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      d57916a0
    • Mike Snitzer's avatar
      dm thin: use block_size_is_power_of_two · 58f77a21
      Mike Snitzer authored
      Use block_size_is_power_of_two() rather than checking
      sectors_per_block_shift directly.  Also introduce local pool variable in
      get_bio_block() to eliminate redundant tc->pool dereferences.
      
      No functional change.
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      58f77a21
    • Mikulas Patocka's avatar
      dm bufio: use WRITE_FLUSH instead of REQ_FLUSH · 3daec3b4
      Mikulas Patocka authored
      Use WRITE_FLUSH instead of REQ_FLUSH for submitted requests to make it
      consistent with the rest of the kernel. There is no functional change.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      3daec3b4
    • Wang Sheng-Hui's avatar
      dm table: remove superfluous variable reset · d2ce70a1
      Wang Sheng-Hui authored
      If allocation fails, the local var *t is not used any more after kfree.
      Don't need to reset it to NULL. Remove the unnecesary NULL set here.
      Signed-off-by: default avatarWang Sheng-Hui <shhuiw@gmail.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      d2ce70a1
    • Mike Snitzer's avatar
      dm thin: support a non power of 2 discard_granularity · f13945d7
      Mike Snitzer authored
      Support a non-power-of-2 discard granularity in dm-thin, now that the block
      layer supports this(via 8dd2cb7e "block:
      discard granularity might not be power of 2" and
      59771079 "blk: avoid divide-by-zero with zero
      discard granularity").
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      f13945d7
    • Mikulas Patocka's avatar
      dm: fix truncated status strings · fd7c092e
      Mikulas Patocka authored
      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: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      fd7c092e
    • Jun'ichi Nomura's avatar
      dm: do not replace bioset for request based dm · 16245bdc
      Jun'ichi Nomura authored
      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: default avatarBart Van Assche <bvanassche@acm.org>
      Tested-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Acked-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      16245bdc
    • 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 31 commits