linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] IMSM Checkpointing Bug Fix Series (3)
@ 2011-06-10 15:56 Adam Kwolek
  2011-06-10 15:56 ` [PATCH 1/2] imsm: Fix: klocwork: targets variable can be used uninitialized Adam Kwolek
  2011-06-10 15:56 ` [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL Adam Kwolek
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-06-10 15:56 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

The following series implements fixes for potential problems found
using Klocwork.

For complete solution all sent patches (7) needs to be applied:
  1. imsm: FIX: Cannot create volume
  2. FIX: Cannot create volume
  3. imsm: FIX: Use function to obtain array layout
  4. imsm: FIX: Disable automatic metadata rollback for broken reshape
  5. imsm: FIX: Raid5 data corruption data recovering from backup
  6. imsm: Fix: klocwork: targets variable can be used uninitialized
  7. imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL

IMSM Checkpointing Status: All unit tests passed

BR
Adam


---

Adam Kwolek (2):
      imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL
      imsm: Fix: klocwork: targets variable can be used uninitialized


 super-intel.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

-- 
Signature

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] imsm: Fix: klocwork: targets variable can be used uninitialized
  2011-06-10 15:56 [PATCH 0/2] IMSM Checkpointing Bug Fix Series (3) Adam Kwolek
@ 2011-06-10 15:56 ` Adam Kwolek
  2011-06-10 15:56 ` [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL Adam Kwolek
  1 sibling, 0 replies; 4+ messages in thread
From: Adam Kwolek @ 2011-06-10 15:56 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

When target_offsets allocation fails execution goes to abort label,
where elements from targets table are closed.

Initialize targets table after allocation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 40fd940..8dd0805 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7724,6 +7724,9 @@ int save_backup_imsm(struct supertype *st,
 	if (!targets)
 		goto abort;
 
+	for (i = 0; i < new_disks; i++)
+		targets[i] = -1;
+
 	target_offsets = malloc(new_disks * sizeof(unsigned long long));
 	if (!target_offsets)
 		goto abort;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL
  2011-06-10 15:56 [PATCH 0/2] IMSM Checkpointing Bug Fix Series (3) Adam Kwolek
  2011-06-10 15:56 ` [PATCH 1/2] imsm: Fix: klocwork: targets variable can be used uninitialized Adam Kwolek
@ 2011-06-10 15:56 ` Adam Kwolek
  2011-06-14  2:50   ` NeilBrown
  1 sibling, 1 reply; 4+ messages in thread
From: Adam Kwolek @ 2011-06-10 15:56 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

Pointer dev2 passed in write_super_imsm():4451 can be equal to NULL.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 8dd0805..3b4010d 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5321,6 +5321,9 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
 
 static int is_gen_migration(struct imsm_dev *dev)
 {
+	if (dev == NULL)
+		return 0;
+
 	if (!dev->vol.migr_state)
 		return 0;
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL
  2011-06-10 15:56 ` [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL Adam Kwolek
@ 2011-06-14  2:50   ` NeilBrown
  0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2011-06-14  2:50 UTC (permalink / raw)
  To: Adam Kwolek
  Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

On Fri, 10 Jun 2011 17:56:39 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Pointer dev2 passed in write_super_imsm():4451 can be equal to NULL.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  super-intel.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 8dd0805..3b4010d 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5321,6 +5321,9 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
>  
>  static int is_gen_migration(struct imsm_dev *dev)
>  {
> +	if (dev == NULL)
> +		return 0;
> +
>  	if (!dev->vol.migr_state)
>  		return 0;
>  


Thanks.  I have applied this and most of the others you sent. 

NeilBrown


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-14  2:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 15:56 [PATCH 0/2] IMSM Checkpointing Bug Fix Series (3) Adam Kwolek
2011-06-10 15:56 ` [PATCH 1/2] imsm: Fix: klocwork: targets variable can be used uninitialized Adam Kwolek
2011-06-10 15:56 ` [PATCH 2/2] imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL Adam Kwolek
2011-06-14  2:50   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).