1. 11 7月, 2013 1 次提交
    • M
      dm: optimize use SRCU and RCU · 83d5e5b0
      Mikulas Patocka 提交于
      This patch removes "io_lock" and "map_lock" in struct mapped_device and
      "holders" in struct dm_table and replaces these mechanisms with
      sleepable-rcu.
      
      Previously, the code would call "dm_get_live_table" and "dm_table_put" to
      get and release table. Now, the code is changed to call "dm_get_live_table"
      and "dm_put_live_table". dm_get_live_table locks sleepable-rcu and
      dm_put_live_table unlocks it.
      
      dm_get_live_table_fast/dm_put_live_table_fast can be used instead of
      dm_get_live_table/dm_put_live_table. These *_fast functions use
      non-sleepable RCU, so the caller must not block between them.
      
      If the code changes active or inactive dm table, it must call
      dm_sync_table before destroying the old table.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      83d5e5b0
  2. 02 3月, 2013 2 次提交
    • M
      dm ioctl: allow message to return data · a2606241
      Mikulas Patocka 提交于
      This patch introduces enhanced message support that allows the
      device-mapper core to recognise messages that are common to all devices,
      and for messages to return data to userspace.
      
      Core messages are processed by the function "message_for_md".  If the
      device mapper doesn't support the message, it is passed to the target
      driver.
      
      If the message returns data, the kernel sets the flag
      DM_MESSAGE_OUT_FLAG.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      a2606241
    • M
      dm ioctl: optimize functions without variable params · 02cde50b
      Mikulas Patocka 提交于
      Device-mapper ioctls receive and send data in a buffer supplied
      by userspace.  The buffer has two parts.  The first part contains
      a 'struct dm_ioctl' and has a fixed size.  The second part depends
      on the ioctl and has a variable size.
      
      This patch recognises the specific ioctls that do not use the variable
      part of the buffer and skips allocating memory for it.
      
      In particular, when a device is suspended and a resume ioctl is sent,
      this now avoid memory allocation completely.
      
      The variable "struct dm_ioctl tmp" is moved from the function
      copy_params to its caller ctl_ioctl and renamed to param_kernel.
      It is used directly when the ioctl function doesn't need any arguments.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      02cde50b
  3. 22 12月, 2012 1 次提交
  4. 13 10月, 2012 1 次提交
  5. 27 7月, 2012 2 次提交
    • A
      dm thin: commit before gathering status · 1f4e0ff0
      Alasdair G Kergon 提交于
      Commit outstanding metadata before returning the status for a dm thin
      pool so that the numbers reported are as up-to-date as possible.
      
      The commit is not performed if the device is suspended or if
      the DM_NOFLUSH_FLAG is supplied by userspace and passed to the target
      through a new 'status_flags' parameter in the target's dm_status_fn.
      
      The userspace dmsetup tool will support the --noflush flag with the
      'dmsetup status' and 'dmsetup wait' commands from version 1.02.76
      onwards.
      Tested-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      1f4e0ff0
    • M
      dm: support non power of two target max_io_len · 542f9038
      Mike Snitzer 提交于
      Remove the restriction that limits a target's specified maximum incoming
      I/O size to be a power of 2.
      
      Rename this setting from 'split_io' to the less-ambiguous 'max_io_len'.
      Change it from sector_t to uint32_t, which is plenty big enough, and
      introduce a wrapper function dm_set_target_max_io_len() to set it.
      Use sector_div() to process it now that it is not necessarily a power of 2.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      542f9038
  6. 01 11月, 2011 1 次提交
    • A
      dm table: add immutable feature · 36a0456f
      Alasdair G Kergon 提交于
      Introduce DM_TARGET_IMMUTABLE to indicate that the target type cannot be mixed
      with any other target type, and once loaded into a device, it cannot be
      replaced with a table containing a different type.
      
      The thin provisioning pool device will use this.
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      36a0456f
  7. 02 8月, 2011 1 次提交
  8. 24 3月, 2011 1 次提交
    • M
      dm ioctl: add flag to wipe buffers for secure data · f8681205
      Milan Broz 提交于
      Add DM_SECURE_DATA_FLAG which userspace can use to ensure
      that all buffers allocated for dm-ioctl are wiped
      immediately after use.
      
      The user buffer is wiped as well (we do not want to keep
      and return sensitive data back to userspace if the flag is set).
      
      Wiping is useful for cryptsetup to ensure that the key
      is present in memory only in defined places and only
      for the time needed.
      
      (For crypt, key can be present in table during load or table
      status, wait and message commands).
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      f8681205
  9. 14 1月, 2011 2 次提交
  10. 12 8月, 2010 2 次提交
    • P
      dm: allow autoloading of dm mod · 7e507eb6
      Peter Rajnoha 提交于
      Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
      to support dm-mod module autoloading.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      7e507eb6
    • M
      dm ioctl: make bio or request based device type immutable · a5664dad
      Mike Snitzer 提交于
      Determine whether a mapped device is bio-based or request-based when
      loading its first (inactive) table and don't allow that to be changed
      later.
      
      This patch performs different device initialisation in each of the two
      cases.  (We don't think it's necessary to add code to support changing
      between the two types.)
      
      Allowed md->type transitions:
        DM_TYPE_NONE to DM_TYPE_BIO_BASED
        DM_TYPE_NONE to DM_TYPE_REQUEST_BASED
      
      We now prevent table_load from replacing the inactive table with a
      conflicting type of table even after an explicit table_clear.
      
      Introduce 'type_lock' into the struct mapped_device to protect md->type
      and to prepare for the next patch that will change the queue
      initialization and allocate memory while md->type_lock is held.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Acked-by: NKiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      
       drivers/md/dm-ioctl.c    |   15 +++++++++++++++
       drivers/md/dm.c          |   37 ++++++++++++++++++++++++++++++-------
       drivers/md/dm.h          |    5 +++++
       include/linux/dm-ioctl.h |    4 ++--
       4 files changed, 52 insertions(+), 9 deletions(-)
      a5664dad
  11. 06 3月, 2010 1 次提交
  12. 11 12月, 2009 1 次提交
  13. 22 6月, 2009 1 次提交
    • M
      dm ioctl: support cookies for udev · 60935eb2
      Milan Broz 提交于
      Add support for passing a 32 bit "cookie" into the kernel with the
      DM_SUSPEND, DM_DEV_RENAME and DM_DEV_REMOVE ioctls.  The (unsigned)
      value of this cookie is returned to userspace alongside the uevents
      issued by these ioctls in the variable DM_COOKIE.
      
      This means the userspace process issuing these ioctls can be notified
      by udev after udev has completed any actions triggered.
      
      To minimise the interface extension, we pass the cookie into the
      kernel in the event_nr field which is otherwise unused when calling
      these ioctls.  Incrementing the version number allows userspace to
      determine in advance whether or not the kernel supports the cookie.
      If the kernel does support this but userspace does not, there should
      be no impact as the new variable will just get ignored.
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      60935eb2
  14. 27 3月, 2009 1 次提交
  15. 21 7月, 2008 1 次提交
  16. 08 2月, 2008 1 次提交
  17. 20 10月, 2007 1 次提交
    • M
      dm io:ctl use constant struct size · 027d50f9
      Milan Broz 提交于
      Make size of dm_ioctl struct always 312 bytes on all supported
      architectures.
      
      This change retains compatibility with already-compiled code because
      it uses an embedded offset to locate the payload that follows the
      structure.
      
      On 64-bit architectures there is no change at all; on 32-bit
      we are increasing the size of dm-ioctl from 308 to 312 bytes.
      
      Currently with 32-bit userspace / 64-bit kernel on x86_64
      some ioctls (including rename, message) are incorrectly rejected
      by the comparison against 'param + 1'.  This breaks userspace
      lvrename and multipath 'fail_if_no_path' changes, for example.
      
      (BTW Device-mapper uses its own versioning and ignores the ioctl
      size bits.  Only the generic ioctl compat code on mixed arches
      checks them, and that will continue to accept both sizes for now,
      but we intend to list 308 as deprecated and eventually remove it.)
      Signed-off-by: NMilan Broz <mbroz@redhat.com>
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      Cc: Guido Guenther <agx@sigxcpu.org>
      Cc: Kevin Corry <kevcorry@us.ibm.com>
      Cc: stable@kernel.org
      027d50f9
  18. 09 12月, 2006 1 次提交
  19. 03 10月, 2006 3 次提交
  20. 27 6月, 2006 1 次提交
    • A
      [PATCH] dm: prevent removal if open · 5c6bd75d
      Alasdair G Kergon 提交于
      If you misuse the device-mapper interface (or there's a bug in your userspace
      tools) it's possible to end up with 'unlinked' mapped devices that cannot be
      removed until you reboot (along with uninterruptible processes).
      
      This patch prevents you from removing a device that is still open.
      
      It introduces dm_lock_for_deletion() which is called when a device is about to
      be removed to ensure that nothing has it open and nothing further can open it.
       It uses a private open_count for this which also lets us remove one of the
      problematic bdget_disk() calls elsewhere.
      Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5c6bd75d
  21. 28 3月, 2006 1 次提交
  22. 07 1月, 2006 1 次提交
  23. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4