All of lore.kernel.org
 help / color / mirror / Atom feed
From: jes.sorensen@gmail.com
To: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH v3 3/6] imsm: PPL support
Date: Fri, 17 Mar 2017 16:11:17 -0400	[thread overview]
Message-ID: <wrfj4lyrk6je.fsf@gmail.com> (raw)
In-Reply-To: <20170316210948.21093-4-artur.paszkiewicz@intel.com> (Artur Paszkiewicz's message of "Thu, 16 Mar 2017 22:09:45 +0100")

Artur Paszkiewicz <artur.paszkiewicz@intel.com> writes:
> Enable creating and assembling IMSM raid5 arrays with PPL. Update the
> IMSM metadata format to include new fields used for PPL.
>
> Add structures for PPL metadata. They are used also by super1 and shared
> with the kernel, so put them in md_p.h.
>
> Write the initial empty PPL header when creating an array. When
> assembling an array with PPL, validate the PPL header and in case it is
> not correct allow to overwrite it if --force was provided.
>
> Write the PPL location and size for a device to the new rdev sysfs
> attributes 'ppl_sector' and 'ppl_size'. Enable PPL in the kernel by
> writing to 'consistency_policy' before the array is activated.
>
> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
>  Assemble.c    |  49 +++++++++++
>  Makefile      |   5 +-
>  md_p.h        |  25 ++++++
>  mdadm.h       |   6 ++
>  super-intel.c | 274 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
>  sysfs.c       |  14 +++
>  6 files changed, 349 insertions(+), 24 deletions(-)
>
> diff --git a/Assemble.c b/Assemble.c
> index 3da09033..8e55b49f 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1942,6 +1942,55 @@ int assemble_container_content(struct supertype *st, int mdfd,
>  	map_update(NULL, fd2devnm(mdfd), content->text_version,
>  		   content->uuid, chosen_name);
>  
> +	if (content->consistency_policy == CONSISTENCY_POLICY_PPL &&
> +	    st->ss->validate_ppl) {
> +		content->array.state |= 1;
> +		err = 0;
> +
> +		for (dev = content->devs; dev; dev = dev->next) {
> +			int dfd;
> +			char *devpath;
> +			int ret;
> +
> +			ret = st->ss->validate_ppl(st, content, dev);
> +			if (ret == 0)
> +				continue;
> +
> +			if (ret < 0) {
> +				err = 1;
> +				break;
> +			}
> +
> +			if (!c->force) {
> +				pr_err("%s contains invalid PPL - consider --force or --update-subarray with --update=no-ppl\n",
> +					chosen_name);
> +				content->array.state &= ~1;
> +				avail[dev->disk.raid_disk] = 0;
> +				break;
> +			}
> +
> +			/* have --force - overwrite the invalid ppl */
> +			devpath = map_dev(dev->disk.major, dev->disk.minor, 0);
> +			dfd = dev_open(devpath, O_RDWR);
> +			if (dfd < 0) {
> +				pr_err("Failed to open %s\n", devpath);
> +				err = 1;
> +				break;
> +			}
> +
> +			err = st->ss->write_init_ppl(st, content, dfd);
> +			close(dfd);
> +
> +			if (err)
> +				break;
> +		}
> +
> +		if (err) {
> +			free(avail);
> +			return err;
> +		}
> +	}
> +
>  	if (enough(content->array.level, content->array.raid_disks,
>  		   content->array.layout, content->array.state & 1, avail) == 0) {
>  		if (c->export && result)
> diff --git a/Makefile b/Makefile
> index a6f464c3..49da491f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -146,7 +146,7 @@ MON_OBJS = mdmon.o monitor.o managemon.o util.o maps.o mdstat.o sysfs.o \
>  	Kill.o sg_io.o dlink.o ReadMe.o super-intel.o \
>  	super-mbr.o super-gpt.o \
>  	super-ddf.o sha1.o crc32.o msg.o bitmap.o xmalloc.o \
> -	platform-intel.o probe_roms.o
> +	platform-intel.o probe_roms.o crc32c.o
>  
>  MON_SRCS = $(patsubst %.o,%.c,$(MON_OBJS))
>  
> @@ -156,7 +156,8 @@ STATICOBJS = pwgr.o
>  ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \
>  	maps.c lib.c xmalloc.c \
>  	super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \
> -	platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mapfile.c
> +	platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mapfile.c \
> +	crc32c.o

Hi Artur,

This looks odd - sure you don't mean crc32c.c ?

Thanks,
Jes

  reply	other threads:[~2017-03-17 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 21:09 [PATCH v3 0/6] mdadm support for Partial Parity Log Artur Paszkiewicz
2017-03-16 21:09 ` [PATCH v3 1/6] Generic support for --consistency-policy and PPL Artur Paszkiewicz
2017-03-16 21:09 ` [PATCH v3 2/6] Detail: show consistency policy Artur Paszkiewicz
2017-03-16 21:09 ` [PATCH v3 3/6] imsm: PPL support Artur Paszkiewicz
2017-03-17 20:11   ` jes.sorensen [this message]
2017-03-20  8:07     ` Artur Paszkiewicz
2017-03-28 18:21       ` jes.sorensen
2017-03-16 21:09 ` [PATCH v3 4/6] super1: " Artur Paszkiewicz
2017-03-16 21:09 ` [PATCH v3 5/6] Add 'ppl' and 'no-ppl' options for --update= Artur Paszkiewicz
2017-03-16 21:09 ` [PATCH v3 6/6] Grow: support consistency policy change 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=wrfj4lyrk6je.fsf@gmail.com \
    --to=jes.sorensen@gmail.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.