mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yi Yang <yi.y.yang@intel.com>
To: linux-kernel@vger.kernel.org
Cc: jbrassow@redhat.com, akpm@linux-foundation.org,
	torvalds@linux-foundation.org
Subject: [PATCH 2.6.31-rc1] dm: fix exstore lookup error
Date: Fri, 26 Jun 2009 18:51:23 +0800	[thread overview]
Message-ID: <1246013483.3289.9.camel@localhost.localdomain> (raw)

Live image with 2.6.30 kernel created by livecd-tools can't boot because
of device mapper driver regression, error info is below:

device-mapper: snapshot exception stores: Module for exstore type "p" not found

commit f6bd4eb73cdf2a5bf954e497972842f39cabb7e3 claimed it fixed a regression,
but actually it introduced another error, 'p' in the above error message will
become 'P' followed by many strange characters.

The root cause is the variable persistent is of type char but it is used as char
*, so commit f6bd4eb73cdf2a5bf954e497972842f39cabb7e3 didn't fix the issue and
introduced one more issue.

This patch can fix this regression and the issue commit
f6bd4eb73cdf2a5bf954e497972842f39cabb7e3 introduced, please consider to apply,
thanks

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---

diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index c3ae515..83c0854 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -197,7 +197,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
 	int r = 0;
 	struct dm_exception_store_type *type;
 	struct dm_exception_store *tmp_store;
-	char persistent;
+	char persistent[2];
 
 	if (argc < 3) {
 		ti->error = "Insufficient exception store arguments";
@@ -210,13 +210,14 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
 		return -ENOMEM;
 	}
 
-	persistent = toupper(*argv[1]);
-	if (persistent != 'P' && persistent != 'N') {
+	persistent[0] = toupper(*argv[1]);
+	if (persistent[0] != 'P' && persistent[0] != 'N') {
 		ti->error = "Persistent flag is not P or N";
 		return -EINVAL;
 	}
 
-	type = get_type(&persistent);
+	persistent[1] = '\0';
+	type = get_type(persistent);
 	if (!type) {
 		ti->error = "Exception store type not recognised";
 		r = -EINVAL;



                 reply	other threads:[~2009-06-26 10:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1246013483.3289.9.camel@localhost.localdomain \
    --to=yi.y.yang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=jbrassow@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome