Linux block layer
 help / color / mirror / Atom feed
From: Richard Narron <comet.berkeley@gmail.com>
To: linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Andries Brouwer <aeb@cwi.nl>
Subject: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
Date: Thu, 25 May 2017 21:52:50 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.21.1705252147520.2125@joy.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:

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andries Brouwer <aeb@cwi.nl>
Cc: linux-block@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Richard Narron <comet.berkeley@gmail.com>
---
Changelog v2->v3:
- Add Cc:
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-26  4:52 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=alpine.LNX.2.21.1705252147520.2125@joy.test \
    --to=comet.berkeley@gmail.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