linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] IMSM: Initialize my_vol_raid_dev_num during vol creation
@ 2017-04-26  9:08 Pawel Baldysiak
  2017-05-02 14:49 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Baldysiak @ 2017-04-26  9:08 UTC (permalink / raw)
  To: linux-raid; +Cc: jes.serensen, Pawel Baldysiak

This field was not initialized so far. This ID needs to be unique
for every newly created array in container.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
---
 super-intel.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 0aed57c..d5c77c0 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -232,8 +232,13 @@ struct imsm_super {
 	__u32 orig_family_num;		/* 0x40 - 0x43 original family num */
 	__u32 pwr_cycle_count;		/* 0x44 - 0x47 simulated power cycle count for array */
 	__u32 bbm_log_size;		/* 0x48 - 0x4B - size of bad Block Mgmt Log in bytes */
-#define IMSM_FILLERS 35
-	__u32 filler[IMSM_FILLERS];	/* 0x4C - 0xD7 RAID_MPB_FILLERS */
+	__u16 num_raid_devs_created;	/* 0x4C - 0x4D Used for generating unique
+					 * volume IDs for raid_dev created in this array
+					 * (starts at 1)
+					 */
+	__u16 filler1;			/* 0x4E - 0x4F */
+#define IMSM_FILLERS 34
+	__u32 filler[IMSM_FILLERS];	/* 0x50 - 0xD7 RAID_MPB_FILLERS */
 	struct imsm_disk disk[1];	/* 0xD8 diskTbl[numDisks] */
 	/* here comes imsm_dev[num_raid_devs] */
 	/* here comes BBM logs */
@@ -5368,6 +5373,8 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
 		set_imsm_ord_tbl_ent(map, i, IMSM_ORD_REBUILD);
 	}
 	mpb->num_raid_devs++;
+	mpb->num_raid_devs_created++;
+	dev->my_vol_raid_dev_num = mpb->num_raid_devs_created;
 
 	if (s->consistency_policy == UnSet ||
 	    s->consistency_policy == CONSISTENCY_POLICY_RESYNC ||
-- 
2.9.3


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

* Re: [PATCH 1/1] IMSM: Initialize my_vol_raid_dev_num during vol creation
  2017-04-26  9:08 [PATCH 1/1] IMSM: Initialize my_vol_raid_dev_num during vol creation Pawel Baldysiak
@ 2017-05-02 14:49 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2017-05-02 14:49 UTC (permalink / raw)
  To: Pawel Baldysiak; +Cc: linux-raid

On 04/26/2017 05:08 AM, Pawel Baldysiak wrote:
> This field was not initialized so far. This ID needs to be unique
> for every newly created array in container.
>
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
>  super-intel.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/super-intel.c b/super-intel.c
> index 0aed57c..d5c77c0 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -232,8 +232,13 @@ struct imsm_super {
>  	__u32 orig_family_num;		/* 0x40 - 0x43 original family num */
>  	__u32 pwr_cycle_count;		/* 0x44 - 0x47 simulated power cycle count for array */
>  	__u32 bbm_log_size;		/* 0x48 - 0x4B - size of bad Block Mgmt Log in bytes */
> -#define IMSM_FILLERS 35
> -	__u32 filler[IMSM_FILLERS];	/* 0x4C - 0xD7 RAID_MPB_FILLERS */
> +	__u16 num_raid_devs_created;	/* 0x4C - 0x4D Used for generating unique
> +					 * volume IDs for raid_dev created in this array
> +					 * (starts at 1)
> +					 */
> +	__u16 filler1;			/* 0x4E - 0x4F */
> +#define IMSM_FILLERS 34
> +	__u32 filler[IMSM_FILLERS];	/* 0x50 - 0xD7 RAID_MPB_FILLERS */
>  	struct imsm_disk disk[1];	/* 0xD8 diskTbl[numDisks] */
>  	/* here comes imsm_dev[num_raid_devs] */
>  	/* here comes BBM logs */
> @@ -5368,6 +5373,8 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
>  		set_imsm_ord_tbl_ent(map, i, IMSM_ORD_REBUILD);
>  	}
>  	mpb->num_raid_devs++;
> +	mpb->num_raid_devs_created++;
> +	dev->my_vol_raid_dev_num = mpb->num_raid_devs_created;
>
>  	if (s->consistency_policy == UnSet ||
>  	    s->consistency_policy == CONSISTENCY_POLICY_RESYNC ||
>

Applied!

I didn't see this one as you got my email address wrong, but it's in my 
tree now.

Thanks,
Jes


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

end of thread, other threads:[~2017-05-02 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26  9:08 [PATCH 1/1] IMSM: Initialize my_vol_raid_dev_num during vol creation Pawel Baldysiak
2017-05-02 14:49 ` Jes Sorensen

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).