Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651296

[PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized

From Richard Narron <comet.berkeley@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
Date 2017-05-26 12:50 +0200
Message-ID <tLkYF-4LU-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not  recognized Richard Narron <comet.berkeley@gmail.com> - 2017-05-26 12:50 +0200
  Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Jens Axboe <axboe@kernel.dk> - 2017-05-26 15:30 +0200
  Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Joe Perches <joe@perches.com> - 2017-05-26 16:40 +0200
    Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Joe Perches <joe@perches.com> - 2017-05-27 03:30 +0200
      Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Joe Perches <joe@perches.com> - 2017-05-27 04:00 +0200
        Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Richard Narron <comet.berkeley@gmail.com> - 2017-05-27 05:30 +0200
          Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Joe Perches <joe@perches.com> - 2017-05-27 06:30 +0200
    Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are  not recognized Richard Narron <comet.berkeley@gmail.com> - 2017-05-27 03:40 +0200

csiph-web