All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Zielcke <fzielcke@z-51.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] skip over invalid BSD partitions
Date: Tue, 05 Aug 2008 15:19:06 +0200	[thread overview]
Message-ID: <1217942346.20134.1.camel@fz.local> (raw)
In-Reply-To: <87d4knehfs.fsf@xs4all.nl>

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

Am Dienstag, den 05.08.2008, 15:10 +0200 schrieb Marco Gerards:
> Felix Zielcke <fzielcke87@googlemail.com> writes:
> 
> > 2008-08-05  Felix Zielcke  <fzielcke@z-51.de>
> >
> > 	* partmap/pc.c (pc_partition_map_iterate): Do not abort on an invalid BSD
> > 	magic or if there's no space left, use grub_dprintf to issue a warning.
> 
> Looks fine.
Hurray.

> > +		    {
> > +		      grub_dprintf ("partition",
> > +				    "invalid disk label magic 0x%x on partition %d\n"
> > +				    label.magic, p.index);
> > +		      continue;
> > +		    }
> 
> Isn't a comma missing after the second string?  I am surprised that
> this compiles.  Or am I missing something?
> 
You're right, shame on me I notice to missing spaces but not a missing
comma.
Attached.

[-- Attachment #2: skip_invalid_bsd_parts.diff --]
[-- Type: text/x-patch, Size: 1137 bytes --]

Index: partmap/pc.c
===================================================================
--- partmap/pc.c	(Revision 1770)
+++ partmap/pc.c	(Arbeitskopie)
@@ -160,9 +160,10 @@
 		{
 		  /* Check if the BSD label is within the DOS partition.  */
 		  if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR)
-		    return grub_error (GRUB_ERR_BAD_PART_TABLE,
-				       "no space for disk label");
-
+		    {
+		      grub_dprintf ("partition", "no space for disk label\n");
+		      continue;
+		    }
 		  /* Read the BSD label.  */
 		  if (grub_disk_read (&raw,
 				      (p.start
@@ -175,10 +176,12 @@
 		  /* Check if it is valid.  */
 		  if (label.magic
 		      != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC))
-		    return grub_error (GRUB_ERR_BAD_PART_TABLE,
-				       "invalid disk label magic 0x%x",
-				       label.magic);
-
+		    {
+		      grub_dprintf ("partition",
+				    "invalid disk label magic 0x%x on partition %d\n",
+				    label.magic, p.index);
+		      continue;
+		    }
 		  for (pcdata.bsd_part = 0;
 		       pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions);
 		       pcdata.bsd_part++)

  parent reply	other threads:[~2008-08-05 13:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 23:19 [PATCH] skip over invalid BSD partitions Felix Zielcke
2008-08-01 10:40 ` Marco Gerards
2008-08-01 10:48   ` Felix Zielcke
2008-08-01 13:02   ` Robert Millan
2008-08-05 10:16     ` Marco Gerards
2008-08-05 10:49       ` Felix Zielcke
2008-08-05 11:38         ` Felix Zielcke
2008-08-05 13:10           ` Marco Gerards
2008-08-05 13:15             ` Felix Zielcke
2008-08-05 13:19             ` Felix Zielcke [this message]
2008-08-05 15:41               ` Marco Gerards

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=1217942346.20134.1.camel@fz.local \
    --to=fzielcke@z-51.de \
    --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.