linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm --detail was incorrect for shrinking reshapes
@ 2011-06-20 16:06 Andrew Burgess
  2011-06-23  1:47 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Burgess @ 2011-06-20 16:06 UTC (permalink / raw)
  To: linux raid mailing list; +Cc: NeilBrown

Since info->delta_disks is signed it doesn't need to be special-cased.

This allowed my 9->8 reshape to display correctly instead of as 8->7

(the "This is pretty boring" context is apparently the universe's
opinion of my first patch!)


mdadm> git diff
diff --git a/Detail.c b/Detail.c
index 375189d..40806cf 100644
--- a/Detail.c
+++ b/Detail.c
@@ -430,12 +430,9 @@ This is pretty boring
  			printf("  Reshape pos'n : %llu%s\n", (unsigned  
long long) info->reshape_progress<<9,
  			       human_size((unsigned long  
long)info->reshape_progress<<9));
  #endif
-			if (info->delta_disks > 0)
+			if (info->delta_disks != 0)
  				printf("  Delta Devices : %d,  
(%d->%d)\n",
  				       info->delta_disks,  
array.raid_disks - info->delta_disks, array.raid_disks);
-			if (info->delta_disks < 0)
-				printf("  Delta Devices : %d,  
(%d->%d)\n",
-				       info->delta_disks,  
array.raid_disks, array.raid_disks + info->delta_disks);
  			if (info->new_level != array.level) {
  				char *c = map_num(pers,  
info->new_level);
  				printf("      New Level : %s\n",  
c?c:"-unknown-");

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

* Re: [PATCH] mdadm --detail was incorrect for shrinking reshapes
  2011-06-20 16:06 [PATCH] mdadm --detail was incorrect for shrinking reshapes Andrew Burgess
@ 2011-06-23  1:47 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-06-23  1:47 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: linux raid mailing list

On Mon, 20 Jun 2011 09:06:55 -0700 Andrew Burgess <aab@cichlid.com> wrote:

> Since info->delta_disks is signed it doesn't need to be special-cased.
> 
> This allowed my 9->8 reshape to display correctly instead of as 8->7
> 
> (the "This is pretty boring" context is apparently the universe's
> opinion of my first patch!)
> 
> 
> mdadm> git diff
> diff --git a/Detail.c b/Detail.c
> index 375189d..40806cf 100644
> --- a/Detail.c
> +++ b/Detail.c
> @@ -430,12 +430,9 @@ This is pretty boring
>   			printf("  Reshape pos'n : %llu%s\n", (unsigned  
> long long) info->reshape_progress<<9,
>   			       human_size((unsigned long  
> long)info->reshape_progress<<9));
>   #endif
> -			if (info->delta_disks > 0)
> +			if (info->delta_disks != 0)
>   				printf("  Delta Devices : %d,  
> (%d->%d)\n",
>   				       info->delta_disks,  
> array.raid_disks - info->delta_disks, array.raid_disks);
> -			if (info->delta_disks < 0)
> -				printf("  Delta Devices : %d,  
> (%d->%d)\n",
> -				       info->delta_disks,  
> array.raid_disks, array.raid_disks + info->delta_disks);
>   			if (info->new_level != array.level) {
>   				char *c = map_num(pers,  
> info->new_level);
>   				printf("      New Level : %s\n",  
> c?c:"-unknown-");
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Thanks.

BTW "format=flowed" doesn't really work for patches.. Fortunately it was
small enough that I could just apply it by hand.

I had originally planned that "raid_disk" should always be the maximum of the
"before" and "after" number of devices in the array - so that it needed
exactly "raid_disks" devices to be non-degraded etc.  It seems that didn't
really work out but I never fixed this code to reflect reality.

Thanks for the patch, it is applied now.

NeilBrown


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

end of thread, other threads:[~2011-06-23  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 16:06 [PATCH] mdadm --detail was incorrect for shrinking reshapes Andrew Burgess
2011-06-23  1:47 ` 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).