Commit a4ffc0a0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (44 commits)
  dm raid1: report fault status
  dm raid1: handle read failures
  dm raid1: fix EIO after log failure
  dm raid1: handle recovery failures
  dm raid1: handle write failures
  dm snapshot: combine consecutive exceptions in memory
  dm: stripe enhanced status return
  dm: stripe trigger event on failure
  dm log: auto load modules
  dm: move deferred bio flushing to workqueue
  dm crypt: use async crypto
  dm crypt: prepare async callback fn
  dm crypt: add completion for async
  dm crypt: add async request mempool
  dm crypt: extract scatterlist processing
  dm crypt: tidy io ref counting
  dm crypt: introduce crypt_write_io_loop
  dm crypt: abstract crypt_write_done
  dm crypt: store sector mapping in dm_crypt_io
  dm crypt: move queue functions
  ...
parents d7511ec8 af195ac8
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -204,7 +204,7 @@ config BLK_DEV_DM


config DM_DEBUG
config DM_DEBUG
	boolean "Device mapper debugging support"
	boolean "Device mapper debugging support"
	depends on BLK_DEV_DM && EXPERIMENTAL
	depends on BLK_DEV_DM
	---help---
	---help---
	  Enable this for messages that may help debug device-mapper problems.
	  Enable this for messages that may help debug device-mapper problems.


@@ -212,7 +212,7 @@ config DM_DEBUG


config DM_CRYPT
config DM_CRYPT
	tristate "Crypt target support"
	tristate "Crypt target support"
	depends on BLK_DEV_DM && EXPERIMENTAL
	depends on BLK_DEV_DM
	select CRYPTO
	select CRYPTO
	select CRYPTO_CBC
	select CRYPTO_CBC
	---help---
	---help---
@@ -230,34 +230,34 @@ config DM_CRYPT
	  If unsure, say N.
	  If unsure, say N.


config DM_SNAPSHOT
config DM_SNAPSHOT
       tristate "Snapshot target (EXPERIMENTAL)"
       tristate "Snapshot target"
       depends on BLK_DEV_DM && EXPERIMENTAL
       depends on BLK_DEV_DM
       ---help---
       ---help---
         Allow volume managers to take writable snapshots of a device.
         Allow volume managers to take writable snapshots of a device.


config DM_MIRROR
config DM_MIRROR
       tristate "Mirror target (EXPERIMENTAL)"
       tristate "Mirror target"
       depends on BLK_DEV_DM && EXPERIMENTAL
       depends on BLK_DEV_DM
       ---help---
       ---help---
         Allow volume managers to mirror logical volumes, also
         Allow volume managers to mirror logical volumes, also
         needed for live data migration tools such as 'pvmove'.
         needed for live data migration tools such as 'pvmove'.


config DM_ZERO
config DM_ZERO
	tristate "Zero target (EXPERIMENTAL)"
	tristate "Zero target"
	depends on BLK_DEV_DM && EXPERIMENTAL
	depends on BLK_DEV_DM
	---help---
	---help---
	  A target that discards writes, and returns all zeroes for
	  A target that discards writes, and returns all zeroes for
	  reads.  Useful in some recovery situations.
	  reads.  Useful in some recovery situations.


config DM_MULTIPATH
config DM_MULTIPATH
	tristate "Multipath target (EXPERIMENTAL)"
	tristate "Multipath target"
	depends on BLK_DEV_DM && EXPERIMENTAL
	depends on BLK_DEV_DM
	---help---
	---help---
	  Allow volume managers to support multipath hardware.
	  Allow volume managers to support multipath hardware.


config DM_MULTIPATH_EMC
config DM_MULTIPATH_EMC
	tristate "EMC CX/AX multipath support (EXPERIMENTAL)"
	tristate "EMC CX/AX multipath support"
	depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL
	depends on DM_MULTIPATH && BLK_DEV_DM
	---help---
	---help---
	  Multipath support for EMC CX/AX series hardware.
	  Multipath support for EMC CX/AX series hardware.


+320 −166

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -449,7 +449,7 @@ static void persistent_destroy(struct exception_store *store)


static int persistent_read_metadata(struct exception_store *store)
static int persistent_read_metadata(struct exception_store *store)
{
{
	int r, new_snapshot;
	int r, uninitialized_var(new_snapshot);
	struct pstore *ps = get_info(store);
	struct pstore *ps = get_info(store);


	/*
	/*
+23 −9
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/dm-ioctl.h>
#include <linux/dm-ioctl.h>
#include <linux/hdreg.h>
#include <linux/hdreg.h>
#include <linux/compat.h>


#include <asm/uaccess.h>
#include <asm/uaccess.h>


@@ -702,7 +703,7 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size)
	int r;
	int r;
	char *new_name = (char *) param + param->data_start;
	char *new_name = (char *) param + param->data_start;


	if (new_name < (char *) param->data ||
	if (new_name < param->data ||
	    invalid_str(new_name, (void *) param + param_size)) {
	    invalid_str(new_name, (void *) param + param_size)) {
		DMWARN("Invalid new logical volume name supplied.");
		DMWARN("Invalid new logical volume name supplied.");
		return -EINVAL;
		return -EINVAL;
@@ -728,7 +729,7 @@ static int dev_set_geometry(struct dm_ioctl *param, size_t param_size)
	if (!md)
	if (!md)
		return -ENXIO;
		return -ENXIO;


	if (geostr < (char *) param->data ||
	if (geostr < param->data ||
	    invalid_str(geostr, (void *) param + param_size)) {
	    invalid_str(geostr, (void *) param + param_size)) {
		DMWARN("Invalid geometry supplied.");
		DMWARN("Invalid geometry supplied.");
		goto out;
		goto out;
@@ -1350,10 +1351,10 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param)
{
{
	struct dm_ioctl tmp, *dmi;
	struct dm_ioctl tmp, *dmi;


	if (copy_from_user(&tmp, user, sizeof(tmp)))
	if (copy_from_user(&tmp, user, sizeof(tmp) - sizeof(tmp.data)))
		return -EFAULT;
		return -EFAULT;


	if (tmp.data_size < sizeof(tmp))
	if (tmp.data_size < (sizeof(tmp) - sizeof(tmp.data)))
		return -EINVAL;
		return -EINVAL;


	dmi = vmalloc(tmp.data_size);
	dmi = vmalloc(tmp.data_size);
@@ -1397,13 +1398,11 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
	return 0;
	return 0;
}
}


static int ctl_ioctl(struct inode *inode, struct file *file,
static int ctl_ioctl(uint command, struct dm_ioctl __user *user)
		     uint command, ulong u)
{
{
	int r = 0;
	int r = 0;
	unsigned int cmd;
	unsigned int cmd;
	struct dm_ioctl *param;
	struct dm_ioctl *uninitialized_var(param);
	struct dm_ioctl __user *user = (struct dm_ioctl __user *) u;
	ioctl_fn fn = NULL;
	ioctl_fn fn = NULL;
	size_t param_size;
	size_t param_size;


@@ -1471,8 +1470,23 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
	return r;
	return r;
}
}


static long dm_ctl_ioctl(struct file *file, uint command, ulong u)
{
	return (long)ctl_ioctl(command, (struct dm_ioctl __user *)u);
}

#ifdef CONFIG_COMPAT
static long dm_compat_ctl_ioctl(struct file *file, uint command, ulong u)
{
	return (long)dm_ctl_ioctl(file, command, (ulong) compat_ptr(u));
}
#else
#define dm_compat_ctl_ioctl NULL
#endif

static const struct file_operations _ctl_fops = {
static const struct file_operations _ctl_fops = {
	.ioctl	 = ctl_ioctl,
	.unlocked_ioctl	 = dm_ctl_ioctl,
	.compat_ioctl = dm_compat_ctl_ioctl,
	.owner	 = THIS_MODULE,
	.owner	 = THIS_MODULE,
};
};


+50 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,7 @@ int dm_unregister_dirty_log_type(struct dirty_log_type *type)
	return 0;
	return 0;
}
}


static struct dirty_log_type *get_type(const char *type_name)
static struct dirty_log_type *_get_type(const char *type_name)
{
{
	struct dirty_log_type *type;
	struct dirty_log_type *type;


@@ -61,6 +61,55 @@ static struct dirty_log_type *get_type(const char *type_name)
	return NULL;
	return NULL;
}
}


/*
 * get_type
 * @type_name
 *
 * Attempt to retrieve the dirty_log_type by name.  If not already
 * available, attempt to load the appropriate module.
 *
 * Log modules are named "dm-log-" followed by the 'type_name'.
 * Modules may contain multiple types.
 * This function will first try the module "dm-log-<type_name>",
 * then truncate 'type_name' on the last '-' and try again.
 *
 * For example, if type_name was "clustered-disk", it would search
 * 'dm-log-clustered-disk' then 'dm-log-clustered'.
 *
 * Returns: dirty_log_type* on success, NULL on failure
 */
static struct dirty_log_type *get_type(const char *type_name)
{
	char *p, *type_name_dup;
	struct dirty_log_type *type;

	type = _get_type(type_name);
	if (type)
		return type;

	type_name_dup = kstrdup(type_name, GFP_KERNEL);
	if (!type_name_dup) {
		DMWARN("No memory left to attempt log module load for \"%s\"",
		       type_name);
		return NULL;
	}

	while (request_module("dm-log-%s", type_name_dup) ||
	       !(type = _get_type(type_name))) {
		p = strrchr(type_name_dup, '-');
		if (!p)
			break;
		p[0] = '\0';
	}

	if (!type)
		DMWARN("Module for logging type \"%s\" not found.", type_name);

	kfree(type_name_dup);

	return type;
}

static void put_type(struct dirty_log_type *type)
static void put_type(struct dirty_log_type *type)
{
{
	spin_lock(&_lock);
	spin_lock(&_lock);
Loading