All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] add support for Linux MD linear level
Date: Sat, 08 Jun 2013 14:49:17 +0200	[thread overview]
Message-ID: <51B3284D.5070804@gmail.com> (raw)
In-Reply-To: <1370695210-10289-1-git-send-email-arvidjaar@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2548 bytes --]

On 08.06.2013 14:40, Andrey Borzenkov wrote:
> This appears to be trivial enough and occasionally useful.
> 
> It also fixes level translation for 1.x super which was broken
> for multipath level as well.
Linear isn't RAID1. You'd need to define a segment for every device.
> 
> Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
> 
> ---
>  ChangeLog                       | 8 ++++++++
>  grub-core/disk/mdraid1x_linux.c | 6 +++---
>  grub-core/disk/mdraid_linux.c   | 4 ++--
>  3 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 4d8f343..e4c1980 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,11 @@
> +2013-06-08  Andrey Borzenkov <arvidjaar@gmail.com>
> +
> +	* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Support
> +	linear level by mapping it to RAID1. Pass correct mapped level
> +	to grub_diskfilter_make_raid.
> +	* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Support
> +	linear level by mapping it to RAID1.
> +
>  2013-06-07  Andrey Borzenkov <arvidjaar@gmail.com>
>  
>  	* grub-core/script/execute.c (grub_script_execute_sourcecode): Split
> diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c
> index a0e65a8..3c18c79 100644
> --- a/grub-core/disk/mdraid1x_linux.c
> +++ b/grub-core/disk/mdraid1x_linux.c
> @@ -160,8 +160,8 @@ grub_mdraid_detect (grub_disk_t disk,
>  
>        level = grub_le_to_cpu32 (sb.level);
>  
> -      /* Multipath.  */
> -      if ((int) level == -4)
> +      /* Multipath or linear  */
> +      if ((int) level == -4 || (int) level == -1)
>  	level = 1;
>  
>        if (level != 0 && level != 1 && level != 4 &&
> @@ -207,7 +207,7 @@ grub_mdraid_detect (grub_disk_t disk,
>  					 : grub_le_to_cpu64 (sb.data_size),
>  					 grub_le_to_cpu32 (sb.chunksize),
>  					 grub_le_to_cpu32 (sb.layout),
> -					 grub_le_to_cpu32 (sb.level));
> +					 level);
>  
>        return array;
>      }
> diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c
> index f408fd3..4e64d72 100644
> --- a/grub-core/disk/mdraid_linux.c
> +++ b/grub-core/disk/mdraid_linux.c
> @@ -216,8 +216,8 @@ grub_mdraid_detect (grub_disk_t disk,
>    /* FIXME: Check the checksum.  */
>  
>    level = grub_md_to_cpu32 (sb.level);
> -  /* Multipath.  */
> -  if ((int) level == -4)
> +  /* Multipath or linear  */
> +  if ((int) level == -4 || (int) level == -1)
>      level = 1;
>  
>    if (level != 0 && level != 1 && level != 4 &&
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

      reply	other threads:[~2013-06-08 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-08 12:40 [PATCH] add support for Linux MD linear level Andrey Borzenkov
2013-06-08 12:49 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]

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=51B3284D.5070804@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.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.