grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] add support for Linux MD linear level
Date: Sat,  8 Jun 2013 16:40:10 +0400	[thread overview]
Message-ID: <1370695210-10289-1-git-send-email-arvidjaar@gmail.com> (raw)

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)


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

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

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=1370695210-10289-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@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 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).