grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add support for Linux MD linear level
@ 2013-06-08 12:40 Andrey Borzenkov
  2013-06-08 12:49 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Borzenkov @ 2013-06-08 12:40 UTC (permalink / raw)
  To: grub-devel

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.

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 &&
-- 
tg: (ac72fb7..) u/md_linear (depends on: master)


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

* Re: [PATCH] add support for Linux MD linear level
  2013-06-08 12:40 [PATCH] add support for Linux MD linear level Andrey Borzenkov
@ 2013-06-08 12:49 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-06-08 12:49 UTC (permalink / raw)
  To: grub-devel

[-- 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 --]

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

end of thread, other threads:[~2013-06-08 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).