* [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
@ 2017-05-21 19:27 Richard
2017-05-23 15:16 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: Richard @ 2017-05-21 19:27 UTC (permalink / raw)
To: Christoph Hellwig, linux-block; +Cc: Jens Axboe, Andries Brouwer
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
@ 2017-05-21 19:47 Richard Narron
2017-05-22 7:39 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Richard Narron @ 2017-05-21 19:47 UTC (permalink / raw)
To: linux-block; +Cc: Christoph Hellwig, Jens Axboe, Andries Brouwer
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-21 19:47 [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Richard Narron
@ 2017-05-22 7:39 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2017-05-22 7:39 UTC (permalink / raw)
To: Richard Narron
Cc: linux-block, Christoph Hellwig, Jens Axboe, Andries Brouwer
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-21 19:27 Richard
@ 2017-05-23 15:16 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2017-05-23 15:16 UTC (permalink / raw)
To: Richard, Christoph Hellwig, linux-block; +Cc: Andries Brouwer
On 05/21/2017 01:27 PM, Richard wrote:
> 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:
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-23 15:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-21 19:47 [PATCH v2 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Richard Narron
2017-05-22 7:39 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2017-05-21 19:27 Richard
2017-05-23 15:16 ` Jens Axboe
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.