01 Nov, 2011

1 commit

  • 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: Alasdair G Kergon

    Alasdair G Kergon
     

02 Aug, 2011

1 commit

  • Move parameter filling from find_device to __find_device_hash_cell.

    This patch causes ioctls using __find_device_hash_cell
    (DM_DEV_REMOVE_CMD, DM_DEV_SUSPEND_CMD - resume, DM_TABLE_CLEAR_CMD)
    to return device parameters, bringing them into line with the other
    ioctls.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

24 Mar, 2011

1 commit

  • 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: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     

14 Jan, 2011

2 commits

  • kmirrord_wq, kcopyd_work and md->wq are created per dm instance and
    serve only a single work item from the dm instance, so non-reentrant
    workqueues would provide the same ordering guarantees as ordered ones
    while allowing CPU affinity and use of the workqueues for other
    purposes. Switch them to non-reentrant workqueues.

    Signed-off-by: Tejun Heo
    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Tejun Heo
     
  • Allow the uuid of a mapped device to be set after device creation.
    Previously the uuid (which is optional) could only be set by
    DM_DEV_CREATE. If no uuid was supplied it could not be set later.

    Sometimes it's necessary to create the device before the uuid is known,
    and in such cases the uuid must be filled in after the creation.

    This patch extends DM_DEV_RENAME to accept a uuid accompanied by
    a new flag DM_UUID_FLAG. This can only be done once and if no
    uuid was previously supplied. It cannot be used to change an
    existing uuid.

    DM_VERSION_MINOR is also bumped to 19 to indicate this interface
    extension is available.

    Signed-off-by: Peter Jones
    Signed-off-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Peter Jones
     

12 Aug, 2010

2 commits

  • Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
    to support dm-mod module autoloading.

    Signed-off-by: Kay Sievers
    Signed-off-by: Peter Rajnoha
    Signed-off-by: Alasdair G Kergon

    Peter Rajnoha
     
  • 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: Mike Snitzer
    Acked-by: Kiyoshi Ueda
    Signed-off-by: Alasdair G Kergon

    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(-)

    Mike Snitzer
     

06 Mar, 2010

1 commit


11 Dec, 2009

1 commit

  • Add the flag DM_QUERY_INACTIVE_TABLE_FLAG to the ioctls to return
    infomation about the loaded-but-not-yet-active table instead of the live
    table. Prior to this patch it was impossible to obtain this information
    until the device had been 'resumed'.

    Userspace dmsetup and libdevmapper support the flag as of version 1.02.40.
    e.g. dmsetup info --inactive vg1-lv1

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     

22 Jun, 2009

1 commit

  • 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: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     

27 Mar, 2009

1 commit

  • This takes care of all files that have only a small number
    of non-strict integer type uses.

    Signed-off-by: Arnd Bergmann
    Cc: Mauro Carvalho Chehab
    Cc: David Airlie
    Cc: Arnaldo Carvalho de Melo
    Cc: YOSHIFUJI Hideaki
    Cc: netdev@vger.kernel.org
    Cc: linux-ppp@vger.kernel.org
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: David Woodhouse
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Ingo Molnar

    Arnd Bergmann
     

21 Jul, 2008

1 commit

  • Introduce a bvec merge function for device mapper devices
    for dynamic size restrictions.

    This code ensures the requested biovec lies within a single
    target and then calls a target-specific function to check
    against any constraints imposed by underlying devices.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Milan Broz
     

08 Feb, 2008

1 commit


20 Oct, 2007

1 commit

  • 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: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Cc: Guido Guenther
    Cc: Kevin Corry
    Cc: stable@kernel.org

    Milan Broz
     

09 Dec, 2006

1 commit

  • Provide a dm ioctl option to request noflush suspending. (See next patch for
    what this is for.) As the interface is extended, the version number is
    incremented.

    Other than accepting the new option through the interface, There is no change
    to existing behaviour.

    Test results:
    Confirmed the option is given from user-space correctly.

    Signed-off-by: Kiyoshi Ueda
    Signed-off-by: Jun'ichi Nomura
    Signed-off-by: Alasdair G Kergon
    Cc: dm-devel@redhat.com
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kiyoshi Ueda
     

03 Oct, 2006

3 commits

  • This patch adds support for a per-target dm_flush_fn method. This is needed
    to allow dm-loop to invalidate page cache mappings in response to BLKFLSBUF
    ioctl commands.

    Signed-off-by: Bryn Reeves
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bryn Reeves
     
  • This patch adds a target preresume hook.

    It is called before the targets are resumed and if it returns an error the
    resume gets cancelled.

    The crypt target will use this to indicate that it is unable to process I/O
    because no encryption key has been supplied.

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     
  • Extend the core device-mapper infrastructure to accept arbitrary ioctls on a
    mapped device provided that it has exactly one target and it is capable of
    supporting ioctls.

    [We can't use unlocked_ioctl because we need 'inode': 'file' might be NULL.
    Is it worth changing this?]

    Signed-off-by: Milan Broz
    Signed-off-by: Alasdair G Kergon

    Arnd Bergmann wrote:

    > Am Wednesday 21 June 2006 21:31 schrieb Alasdair G Kergon:
    > > static struct block_device_operations dm_blk_dops = {
    > > .open = dm_blk_open,
    > > .release = dm_blk_close,
    > > +.ioctl = dm_blk_ioctl,
    > > .getgeo = dm_blk_getgeo,
    > > .owner = THIS_MODULE
    >
    > I guess this also needs a ->compat_ioctl method, otherwise it won't
    > work for ioctl numbers that have a compat_ioctl implementation in the
    > low-level device driver.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Milan Broz
     

27 Jun, 2006

1 commit

  • 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: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alasdair G Kergon
     

28 Mar, 2006

1 commit

  • Allow drive geometry to be stored with a new DM_DEV_SET_GEOMETRY ioctl.
    Device-mapper will now respond to HDIO_GETGEO. If the geometry information is
    not available, zero will be returned for all of the parameters.

    Signed-off-by: Darrick J. Wong
    Signed-off-by: Alasdair G Kergon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Darrick J. Wong
     

07 Jan, 2006

1 commit


17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds