diff options
author | Milan Broz <mbroz@redhat.com> | 2009-06-30 15:18:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:50:48 -0700 |
commit | bac9d5bcb7666d4d6429b4dd00dc8f19295046a9 (patch) | |
tree | 4529a5cdc57c646a3b7fea38b80679f138734676 | |
parent | 97af79aa56868336db493c26a2acaf47996ba1d8 (diff) |
dm exception store: really fix type lookup
commit 874d2f61d31e596c36af7732dc1b3aa2dc233824 upstream.
Fix exception store name handling.
We need to reference exception store by zero terminated string.
Fixes regression introduced in commit f6bd4eb73cdf2a5bf954e497972842f39cabb7e3
Cc: Yi Yang <yi.y.yang@intel.com>
Cc: Jonathan Brassow <jbrassow@redhat.com>
Cc: stable@kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/md/dm-exception-store.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index b86b3c96a57..14ce11e8e03 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -195,7 +195,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, struct dm_exception_store **store) { int r = 0; - struct dm_exception_store_type *type; + struct dm_exception_store_type *type = NULL; struct dm_exception_store *tmp_store; char persistent; @@ -211,12 +211,15 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, } persistent = toupper(*argv[1]); - if (persistent != 'P' && persistent != 'N') { + if (persistent == 'P') + type = get_type("P"); + else if (persistent == 'N') + type = get_type("N"); + else { ti->error = "Persistent flag is not P or N"; return -EINVAL; } - type = get_type(&persistent); if (!type) { ti->error = "Exception store type not recognised"; r = -EINVAL; |