Commit 88626272 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm: sysfs revert add empty release function to avoid debug warning
  dm mpath: fix stall when requeueing io
  dm raid1: fix null pointer dereference in suspend
  dm raid1: fail writes if errors are not handled and log fails
  dm log: userspace fix overhead_size calcuations
  dm snapshot: persistent annotate work_queue as on stack
  dm stripe: avoid divide by zero with invalid stripe count
parents 5ae1d955 9307f6b1
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -172,11 +172,15 @@ int dm_consult_userspace(const char *uuid, uint64_t luid, int request_type,
{
{
	int r = 0;
	int r = 0;
	size_t dummy = 0;
	size_t dummy = 0;
	int overhead_size =
	int overhead_size = sizeof(struct dm_ulog_request) + sizeof(struct cn_msg);
		sizeof(struct dm_ulog_request *) + sizeof(struct cn_msg);
	struct dm_ulog_request *tfr = prealloced_ulog_tfr;
	struct dm_ulog_request *tfr = prealloced_ulog_tfr;
	struct receiving_pkg pkg;
	struct receiving_pkg pkg;


	/*
	 * Given the space needed to hold the 'struct cn_msg' and
	 * 'struct dm_ulog_request' - do we have enough payload
	 * space remaining?
	 */
	if (data_size > (DM_ULOG_PREALLOCED_SIZE - overhead_size)) {
	if (data_size > (DM_ULOG_PREALLOCED_SIZE - overhead_size)) {
		DMINFO("Size of tfr exceeds preallocated size");
		DMINFO("Size of tfr exceeds preallocated size");
		return -EINVAL;
		return -EINVAL;
@@ -191,7 +195,7 @@ resend:
	 */
	 */
	mutex_lock(&dm_ulog_lock);
	mutex_lock(&dm_ulog_lock);


	memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - overhead_size);
	memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - sizeof(struct cn_msg));
	memcpy(tfr->uuid, uuid, DM_UUID_LEN);
	memcpy(tfr->uuid, uuid, DM_UUID_LEN);
	tfr->luid = luid;
	tfr->luid = luid;
	tfr->seq = dm_ulog_seq++;
	tfr->seq = dm_ulog_seq++;
+1 −1
Original line number Original line Diff line number Diff line
@@ -724,7 +724,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes)
	/*
	/*
	 * Dispatch io.
	 * Dispatch io.
	 */
	 */
	if (unlikely(ms->log_failure)) {
	if (unlikely(ms->log_failure) && errors_handled(ms)) {
		spin_lock_irq(&ms->lock);
		spin_lock_irq(&ms->lock);
		bio_list_merge(&ms->failures, &sync);
		bio_list_merge(&ms->failures, &sync);
		spin_unlock_irq(&ms->lock);
		spin_unlock_irq(&ms->lock);
+2 −3
Original line number Original line Diff line number Diff line
@@ -660,10 +660,9 @@ void dm_rh_recovery_end(struct dm_region *reg, int success)
	spin_lock_irq(&rh->region_lock);
	spin_lock_irq(&rh->region_lock);
	if (success)
	if (success)
		list_add(&reg->list, &reg->rh->recovered_regions);
		list_add(&reg->list, &reg->rh->recovered_regions);
	else {
	else
		reg->state = DM_RH_NOSYNC;
		list_add(&reg->list, &reg->rh->failed_recovered_regions);
		list_add(&reg->list, &reg->rh->failed_recovered_regions);
	}

	spin_unlock_irq(&rh->region_lock);
	spin_unlock_irq(&rh->region_lock);


	rh->wakeup_workers(rh->context);
	rh->wakeup_workers(rh->context);
+1 −1
Original line number Original line Diff line number Diff line
@@ -254,7 +254,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
	 * Issue the synchronous I/O from a different thread
	 * Issue the synchronous I/O from a different thread
	 * to avoid generic_make_request recursion.
	 * to avoid generic_make_request recursion.
	 */
	 */
	INIT_WORK(&req.work, do_metadata);
	INIT_WORK_ON_STACK(&req.work, do_metadata);
	queue_work(ps->metadata_wq, &req.work);
	queue_work(ps->metadata_wq, &req.work);
	flush_workqueue(ps->metadata_wq);
	flush_workqueue(ps->metadata_wq);


+1 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
	}
	}


	stripes = simple_strtoul(argv[0], &end, 10);
	stripes = simple_strtoul(argv[0], &end, 10);
	if (*end) {
	if (!stripes || *end) {
		ti->error = "Invalid stripe count";
		ti->error = "Invalid stripe count";
		return -EINVAL;
		return -EINVAL;
	}
	}
Loading