Linux block layer
 help / color / mirror / Atom feed
From: Richard <richard@aaazen.com>
To: Christoph Hellwig <hch@lst.de>,
	linux-block <linux-block@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Andries Brouwer <aeb@cwi.nl>
Subject: [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
Date: Sun, 21 May 2017 12:27:00 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.20.1705211222100.7469@thursday.test> (raw)

The code in block/partitions/msdos.c recognizes FreeBSD, OpenBSD
and NetBSD partitions and does a reasonable job picking out OpenBSD
and NetBSD UFS subpartitions.

But for FreeBSD the subpartitions are always "bad".

    Kernel: <bsd:bad subpartition - ignored

Though all 3 of these BSD systems use UFS as a file system, only
FreeBSD uses relative start addresses in the subpartition
declarations.

The following patch fixes this for FreeBSD partitions and leaves
the code for OpenBSD and NetBSD intact:

Signed-off-by: Richard Narron <comet.berkeley@gmail.com>
---
Changelog v1->v2:
- Improve style, use +=
---
 block/partitions/msdos.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/block/partitions/msdos.c	2015-12-27 18:17:37.000000000 -0800
+++ b/block/partitions/msdos.c	2015-12-29 10:44:25.813773357 -0800
@@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_part
 			continue;
 		bsd_start = le32_to_cpu(p->p_offset);
 		bsd_size = le32_to_cpu(p->p_size);
+		if (memcmp(flavour, "bsd\0", 4) == 0)
+			bsd_start += offset;
 		if (offset == bsd_start && size == bsd_size)
 			/* full parent partition, we have it already */
 			continue;

             reply	other threads:[~2017-05-21 19:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21 19:27 Richard [this message]
2017-05-23 15:16 ` [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2017-05-21 19:47 Richard Narron
2017-05-22  7:39 ` Christoph Hellwig

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=alpine.LNX.2.20.1705211222100.7469@thursday.test \
    --to=richard@aaazen.com \
    --cc=aeb@cwi.nl \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.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