mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] dos-partitions: Fix extended partitions
Date: Tue, 25 Jan 2022 11:41:40 +0100	[thread overview]
Message-ID: <20220125104140.3056337-1-s.hauer@pengutronix.de> (raw)

extended partitions are currently registered with their full size which
means they overlap with the logical partitions therein. Since 7f9f45b9bf
("devfs: Do not create overlapping partitions") we no longer register
overlapping partitions, so the logical partitions are no longer
accessible. Fix this by reducing the size of the extended partition to
two blocks (1kiB) which is the same as Linux does.

Fixes: 7f9f45b9bf ("devfs: Do not create overlapping partitions")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/partitions/dos.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/partitions/dos.c b/common/partitions/dos.c
index 6c76aac371..597d7bf9bc 100644
--- a/common/partitions/dos.c
+++ b/common/partitions/dos.c
@@ -200,6 +200,8 @@ static void dos_partition(void *buf, struct block_device *blk,
 			pd->used_entries++;
 
 			if (is_extended_partition(&pentry)) {
+				pd->parts[n].size = 2;
+
 				if (!extended_partition)
 					extended_partition = &pd->parts[n];
 				else
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


                 reply	other threads:[~2022-01-25 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220125104140.3056337-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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