All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 3/7] imsm: PPL support
Date: Mon, 28 Nov 2016 18:51:31 -0500	[thread overview]
Message-ID: <wrfjlgw3jh8c.fsf@redhat.com> (raw)
In-Reply-To: <20161124122952.16529-4-artur.paszkiewicz@intel.com> (Artur Paszkiewicz's message of "Thu, 24 Nov 2016 13:29:48 +0100")

Artur Paszkiewicz <artur.paszkiewicz@intel.com> writes:
> Enable creating and assembling IMSM raid5 arrays with PPL.
>
> Write the IMSM MPB location for a device to the newly added rdev
> sb_start sysfs attribute and 'journal_ppl' to 'state' attribute for
> every active member.
>
> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
>  mdadm.h       |  1 +
>  super-intel.c | 33 +++++++++++++++++++++++++++++++++
>  sysfs.c       |  4 ++++
>  3 files changed, 38 insertions(+)
>
> diff --git a/mdadm.h b/mdadm.h
> index 4eabf59..5600341 100755
> --- a/mdadm.h
> +++ b/mdadm.h
> @@ -252,6 +252,7 @@ struct mdinfo {
>  	unsigned long long	custom_array_size; /* size for non-default sized
>  						    * arrays (in sectors)
>  						    */
> +	unsigned long long	sb_start;
>  #define NO_RESHAPE		0
>  #define VOLUME_RESHAPE		1
>  #define CONTAINER_RESHAPE	2
> diff --git a/super-intel.c b/super-intel.c
> index df09272..79a3d78 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -1261,6 +1261,15 @@ static void print_imsm_dev(struct intel_super *super,
>  	}
>  	printf("\n");
>  	printf("    Dirty State : %s\n", dev->vol.dirty ? "dirty" : "clean");
> +	printf("     RWH Policy : ");
> +	if (dev->rwh_policy == RWH_OFF)
> +		printf("off\n");
> +	else if (dev->rwh_policy == RWH_DISTRIBUTED)
> +		printf("PPL distributed\n");
> +	else if (dev->rwh_policy == RWH_JOURNALING_DRIVE)
> +		printf("PPL journaling drive\n");
> +	else
> +		printf("<unknown:%d>\n", dev->rwh_policy);
>  }
>  
>  static void print_imsm_disk(struct imsm_disk *disk, int index, __u32 reserved)
> @@ -3043,6 +3052,15 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
>  			}
>  		}
>  	}
> +
> +	if (info->array.level == 5) {
> +		if (dev->rwh_policy == RWH_OFF)
> +			info->rwh_policy = RWH_POLICY_OFF;
> +		else if (dev->rwh_policy == RWH_DISTRIBUTED)
> +			info->rwh_policy = RWH_POLICY_PPL;
> +		else
> +			info->rwh_policy = RWH_POLICY_UNKNOWN;
> +	}
>  }
>  
>  static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev,
> @@ -3177,6 +3195,9 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
>  
>  		disk = &super->disks->disk;
>  		info->data_offset = total_blocks(&super->disks->disk) - reserved;
> +		/* mpb anchor sector - see store_imsm_mpb() */
> +		info->sb_start = total_blocks(&super->disks->disk) -
> +				 ((2 * super->sector_size) >> 9);
>  		info->component_size = reserved;
>  		info->disk.state  = is_configured(disk) ? (1 << MD_DISK_ACTIVE) : 0;
>  		/* we don't change info->disk.raid_disk here because

Hi Artur,

I have been sitting staring at the above for a while, and looking at
store_imsm_mpb() it is not clear to me what is meant to happen here.

For 4k sector drives, aren't you pushing back sb_start way further than
you are for 512 byte sector drives? Ie. you are subtracting 16 sectors
for the 4k drive but only two sectors for the 512 byte sector drive?

Maybe it's because it's Monday or I lost the last of my marbles, but
could you possibly enlighten me here please?

Thanks,
Jes

  reply	other threads:[~2016-11-28 23:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 12:29 [PATCH 0/7] mdadm support for Partial Parity Log Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 1/7] imsm: metadata changes for PPL Artur Paszkiewicz
2016-11-28 23:27   ` Jes Sorensen
2016-11-29 10:47     ` Artur Paszkiewicz
2016-11-29 15:21       ` Jes Sorensen
2016-11-30  7:34         ` Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 2/7] Generic support for --rwh-policy and PPL Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 3/7] imsm: PPL support Artur Paszkiewicz
2016-11-28 23:51   ` Jes Sorensen [this message]
2016-11-29 11:02     ` Artur Paszkiewicz
2016-11-29 15:23       ` Jes Sorensen
2016-11-30  8:07         ` Artur Paszkiewicz
2016-11-30 15:40           ` Jes Sorensen
2016-11-24 12:29 ` [PATCH 4/7] super1: " Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 5/7] imsm: allow to assemble with PPL even if dirty degraded Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 6/7] Allow changing the RWH policy for a running array Artur Paszkiewicz
2016-11-24 12:29 ` [PATCH 7/7] Man page changes for --rwh-policy Artur Paszkiewicz

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=wrfjlgw3jh8c.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=linux-raid@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.